From 2858ceccdcac899e54cbae85e39c9e5578361108 Mon Sep 17 00:00:00 2001 From: chenhang Date: Fri, 26 Jun 2026 10:37:41 +0800 Subject: [PATCH] fix(subscription): trim insignificant price decimals --- src/app/subscription/subscription-screen.helpers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/subscription/subscription-screen.helpers.ts b/src/app/subscription/subscription-screen.helpers.ts index 4cc8406d..a0747b74 100644 --- a/src/app/subscription/subscription-screen.helpers.ts +++ b/src/app/subscription/subscription-screen.helpers.ts @@ -42,7 +42,8 @@ function currencySymbol(currency: string): string { function formatAmount(amountCents: number | null): string | null { if (amountCents === null) return null; - return (amountCents / 100).toFixed(2).replace(/0$/, ""); + if (!Number.isFinite(amountCents)) return null; + return (amountCents / 100).toFixed(2).replace(/\.?0+$/, ""); } function planCaption(