Edge and IE will not display USD / CAD currency symbols when using Intl.NumberFormat

Sorry if this was asked, but I did not find anything ...

The following code in Chrome, Firefox, etc. will return the currency symbol "US $":

new Intl.NumberFormat('en-CA', {
    style: 'currency',
    currencyDisplay: 'symbol',
    currency: 'USD'
}).format(65421.45)

And it will just use "$" if the currency is set to CAD:

new Intl.NumberFormat('en-CA', {
    style: 'currency',
    currencyDisplay: 'symbol',
    currency: 'CAD'
}).format(65421.45)

But in all versions of IE and Edge that I tested, both of these examples will return the currency symbol '$'. It will not return US $ or CA $, regardless of the language or currency used. (The same goes for AUD, HKD, etc.)

Example: https://jsfiddle.net/5wfzk7mf/

This also happens when I use the response-intl function formatNumber()because it uses Intl.NumberFormat.

Am I missing something or is it a browser error?

+4

Source: https://habr.com/ru/post/1674018/


All Articles