Add tax calculation

This commit is contained in:
2026-07-25 14:51:54 -07:00
parent a45586326b
commit 9059665ed2
+10
View File
@@ -0,0 +1,10 @@
import { totalCents, type CartItem, type Discount } from './cart'
export function totalWithTaxCents(
items: CartItem[],
taxRatePercent: number,
discount?: Discount,
): number {
const base = totalCents(items, discount)
return base + base * (taxRatePercent / 100)
}