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 603 forks source link

Get strange result in new version #825

Closed dxvladislavvolkov closed 6 years ago

dxvladislavvolkov commented 6 years ago

I used the old version of this package. After the update, I began to get different results when parsing numbers. You can see the following examples:

  1. globalize 1.1.1 I get the right result ("1.2" => 12) http://plnkr.co/edit/tkZk2rLEsEEOz3siUW6i?p=preview

  2. globalize 1.3.0 I get the wrong result ("1.2" => NaN) http://plnkr.co/edit/NRFJISLDoyCnfTY93Bkg?p=preview

rxaviers commented 6 years ago

Correct, in 1.3.0 that parsing bug was fixed. Note . isn't a decimal separator in de. It would be considered a grouping separator if there were three digits after it.

https://runkit.com/embed/mav67vxk8awb