The only documented way to modify the currency symbol in Globalize is to change the numberFormat.currency.symbol
property of a given culture—in this case, the fr-FR
culture. This will kind of do what you want, but it’s not a very elegant solution, and you would need to manually build a table of correct symbols for each locale and write another method to swap them out. (n.b. It is possible to pass a third argument to Globalize.format
with a different locale identifier, but this just formats the number using that locale’s cultural settings.) Looking at the culture definition syntax, there is simply no provision for displaying different currencies using a given locale.
If you were to look elsewhere, the dojo/currency module in the Dojo Toolkit does do exactly what you need, using data from the Unicode Common Locale Data Repository to determine how to represent various currencies in different locales. So you can set your locale to fr
, write currency.format(3899.888, { currency: "USD" })
, and it will output the currency in USD in the correct format for the French locale.