Intl.NumberFormat currency: $US currency symbol?

Viewed 14412

I don't understand how NumberFormat works.

In France we never use $US so why do I get the following?

new Intl.NumberFormat("fr-FR",{
            style: 'currency',
            currency: 'USD',
            minimumFractionDigits: 2,
         }).format("345")
"345,00 $US"

new Intl.NumberFormat("fr-FR",{
            style: 'currency',
            currency: 'EUR',
            minimumFractionDigits: 2,
         }).format("345")
"345,00 €"

Also: the following does not make any sense to me either. I tried random locales to see the impact and get different results for these 2:

new Intl.NumberFormat("en-HOS",{
            style: 'currency',
            currency: 'USD',
            minimumFractionDigits: 2,
         }).format("345")
"345,00 $US"

new Intl.NumberFormat("en-HOSSDDG",{
            style: 'currency',
            currency: 'USD',
            minimumFractionDigits: 2,
         }).format("345")
"$345.00"

Is this API broken or I miss something?

2 Answers
Related