0

I'm currently looking to use React intl as a way of formatting the currency to be the default of the country that the user is in from the browser. From the documentation, I can see that you input the currency to be a specific type (e.g. USD) - see code below. How would you do it so it's the browser default of the country that the user is in? Is there some sort of default locale I should be using for the currency string?

<IntlProvider locale="en">
  <FormattedNumber value={1000} style="currency" currency="USD" />
</IntlProvider>

// Output = $1,000

Thanks in advance!

bex
  • 7
  • 2
  • Normally you'd have a number/value that is in a certain currency. Intl merely formats it appropriately. €2.00 vs €2,00 vs 2,00 € and so on and so forth – Phil Mar 15 '22 at 12:50
  • Conversion from one currency to another is a problem intl does not solve for you. Using some api or constant conversion rate can be used for that. – Phil Mar 15 '22 at 12:51

0 Answers0