From 6673e63ee768106994d75b361fe9c662790b30a4 Mon Sep 17 00:00:00 2001 From: BilalG1 Date: Thu, 12 Feb 2026 16:52:07 -0800 Subject: [PATCH] fix payment rounding error (#1193) ## Summary by CodeRabbit * **Bug Fixes** * Improved pricing accuracy by implementing proper rounding in unit price calculations during checkout. This ensures correct cent-level precision in purchase computations, preventing potential rounding errors in transaction totals. --- apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx b/apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx index 1660e7492..c01feb43d 100644 --- a/apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx +++ b/apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx @@ -48,7 +48,7 @@ export default function PageClient({ code }: { code: string }) { if (!selectedPriceId || !data?.product?.prices) { return 0; } - return Number(data.product.prices[selectedPriceId].USD) * 100; + return Math.round(Number(data.product.prices[selectedPriceId].USD) * 100); }, [data, selectedPriceId]); const MAX_STRIPE_AMOUNT_CENTS = 999_999 * 100;