currency-formatter
currency-formatter copied to clipboard
Locale's currency is detected case-insensitively while locale-specific formatting is detected case-sensitively
The mapping between a locale and the currency is done case-insensitively, but the mapping between a locale and its locale format is done case sensitively. This can cause a locale's currency to be recognized, but not the formatting, if the user is not careful.
> currency.format("1234.56", { locale: 'en-ie' });
'1 234,56 €'
> currency.format("1234.56", { locale: 'en-IE' });
'€ 1,234.56'