3
Hello folks in my code is as follows
const currencyFormatter = (value: string | number | ReactText[]) => {
return (
<FormattedNumber
value={Number(value)}
style='currency'
currency='BRL'
minimumFractionDigits={2}
maximumFractionDigits={2}
/>
);
}
However the value returned is:
R$4,567.42
But the right thing would be R$ 4.567,42
.
Someone has already done the correction/formatting in this style?
I’ve never particularly used this package, but if you want to simply format the value, you can do it this way:
new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(4567.42)
– Gabriel José de Oliveira
I’ve even used this, it works well, however, I’m following the standard requested by the client that is using this package! :(
– Angelo Reis
That one extension helping?
– Cmte Cardeal