globalizejs / globalize

A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
https://globalizejs.com
MIT License
4.8k stars 605 forks source link

Currency Format issue in French #873

Closed DevReportOne closed 5 years ago

DevReportOne commented 5 years ago

Hello,

When i format a amount in french like that Globalize.locale('fr'); Globalize.currencyFormatter("EUR", <CurrencyFormatterOptions>{ compact: "short", symbolForm: "narrow", minimumFractionDigits: 0, maximumFractionDigits: 2 }) i get "3,78 M €"

The issue is the blank space between "M" and "€" I would like to get "3,78 M€"

Is there a parameter for that? should I modify a CLDR?

Thanks for your help.

rxaviers commented 5 years ago

Yeap that info comes from CLDR: https://github.com/unicode-cldr/cldr-numbers-full/blob/master/main/fr/numbers.json#L120

If you believe that is wrong, please submit a CLDR ticket http://cldr.unicode.org/index/bug-reports

rxaviers commented 5 years ago

Feel free to post it back here for cross reference. Closing the issue here

rxaviers commented 5 years ago

Note at your application-level you can always patch CLDR data. You can also overwrite it with Globalize.load(<slice of the changed data>)

geffkas commented 5 years ago

Hello, I thank you for your answer. Effectively, I managed to handle CLDR data by overwriting it. However, nothing happens if I change this line. I get closer to the result if I change this line. Strangely, something happens if I change this line, using a currency formatter. Is there a way to force the use of "currencyFormats-numberSystem-latn/short/standard/..." ? Thank you by advance.