Skip to content

Commit 0a2a119

Browse files
committed
fix sum in price calculator
1 parent 7594ef9 commit 0a2a119

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/price-calculator.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { CartItem } from "@/types/cart-item";
22

33
/*
4-
Example usage 1,
4+
Example usage 1,
55
const items = [
66
{
77
priceBeforeTax: 19.99,
@@ -18,7 +18,7 @@ import type { CartItem } from "@/types/cart-item";
1818
];
1919
const tax = 0.07;
2020
const total = calculateCartTotal(items, tax);
21-
cosole.log(total); // { status: "success", total: "36.18" }
21+
cosole.log(total); // { status: "success", total: "38.49" }
2222
2323
2424
--------------------------------------------
@@ -45,8 +45,8 @@ import type { CartItem } from "@/types/cart-item";
4545
const total = calculateCartTotal(items, tax);
4646
cosole.log(total); // { status: "error", message: "Cart has duplicate items" }
4747
*/
48-
49-
type CartTotalResult =
48+
49+
type CartTotalResult =
5050
| { status: "success"; total: string }
5151
| { status: "error"; message: string };
5252

0 commit comments

Comments
 (0)