fix(subscription): trim insignificant price decimals
This commit is contained in:
@@ -42,7 +42,8 @@ function currencySymbol(currency: string): string {
|
|||||||
|
|
||||||
function formatAmount(amountCents: number | null): string | null {
|
function formatAmount(amountCents: number | null): string | null {
|
||||||
if (amountCents === null) return 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(
|
function planCaption(
|
||||||
|
|||||||
Reference in New Issue
Block a user