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

numberParser not returning the expected value for locale "sh" or serbian language #925

Closed PratikshaKumbhare closed 3 years ago

PratikshaKumbhare commented 3 years ago

Hello,

We are using the latest version of globalize.js For serbian or locale "sh",when we are trying to parse a number, For ex: 83, the number is converted to 83000.

The numberParser returns wrong value here for locale "sh".

In Serbian , (comma) is used as decimal separator which is same in the case of German.

numberparser

How this could be fixed? How can we get the correct output?

rxaviers commented 3 years ago

It seems like CLDR supports Croatian (hr), but not Serbo-Croatian (sh). [1]

Globalize("hr").formatNumber(88.334)
// > '88,334'

Globalize("hr").parseNumber("88,334")
// > 88.334

1: