Add tax calculation #1

Open
greptile-bot wants to merge 1 commits from add-tax-support into main
+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)
Review

This returns fractional cents - needs rounding

This returns fractional cents - needs rounding
}