From 22e2b21b14fd002a65b6ca6321fe0ff59d77d874 Mon Sep 17 00:00:00 2001 From: m5r Date: Sun, 3 Oct 2021 18:18:34 +0200 Subject: [PATCH] sur Intl.NumberFormat to format currency in billing history --- .../components/billing/billing-history.tsx | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/app/settings/components/billing/billing-history.tsx b/app/settings/components/billing/billing-history.tsx index 956ea7b..f043e4e 100644 --- a/app/settings/components/billing/billing-history.tsx +++ b/app/settings/components/billing/billing-history.tsx @@ -46,33 +46,35 @@ export default function BillingHistory() { - {typeof payments !== "undefined" - ? payments.map((payment) => ( - - - - - - {payment.amount} {payment.currency} - - - {payment.is_paid === 1 ? "Paid" : "Upcoming"} - - - {typeof payment.receipt_url !== "undefined" ? ( - - View receipt - - ) : null} - - - )) - : null} + {payments.map((payment) => ( + + + + + + {Intl.NumberFormat(undefined, { + style: "currency", + currency: payment.currency, + currencyDisplay: "narrowSymbol", + }).format(payment.amount)} + + + {payment.is_paid === 1 ? "Paid" : "Upcoming"} + + + {typeof payment.receipt_url !== "undefined" ? ( + + View receipt + + ) : null} + + + ))}