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

formatNumber returns NaN for 0, if max/minimumSignificantDigits is set #706

Closed AndreR closed 5 years ago

AndreR commented 7 years ago

Hello,

If you call the following function, it returns "NaN %":

Globalize.formatNumber(0, {style:'percent',minimumSignificantDigits: 1,maximumSignificantDigits: 3})

If you leave out the significant digits settings, it returns an empty string, as I would expect.

rxaviers commented 7 years ago

Thanks for reporting this bug.