FormattedNumber of intl-react change semicolon

Question:

Hi guys, 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 .

Has anyone done the correction/formatting in this style?

Answer:

Friend try using the JavaScript property, using the .toLocaleString() function

Below is an explanation of how to use it and what to do.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString

Scroll to Top