From 92cb1b6174bf66595aede8b7a81875173c4f81e1 Mon Sep 17 00:00:00 2001 From: June Date: Fri, 11 Aug 2023 18:46:33 +0200 Subject: [PATCH] set SEK format without decimals --- components/price.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/price.tsx b/components/price.tsx index e7090148d..19dd73b77 100644 --- a/components/price.tsx +++ b/components/price.tsx @@ -1,9 +1,7 @@ -import clsx from 'clsx'; - const Price = ({ amount, className, - currencyCode = 'USD', + currencyCode = 'SEK', currencyCodeClassName }: { amount: string; @@ -12,12 +10,13 @@ const Price = ({ currencyCodeClassName?: string; } & React.ComponentProps<'p'>) => (

- {`${new Intl.NumberFormat(undefined, { + {`${new Intl.NumberFormat('sv-SE', { style: 'currency', currency: currencyCode, - currencyDisplay: 'narrowSymbol' + currencyDisplay: 'narrowSymbol', + minimumFractionDigits: 0, + maximumFractionDigits: 0 }).format(parseFloat(amount))}`} - {`${currencyCode}`}

);