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

Number formats value as "-0" when rounding. #766

Open jrsearles opened 7 years ago

jrsearles commented 7 years ago

If the number is negative and rounds down to 0, the formatting is keeping the negative symbol.

Globalize.formatNumber(-0.25, { minimumFractionDigits: 0, maximumFractionDigits: 0 })

// yields "-0"

// expect "0"
rxaviers commented 7 years ago

Thanks for filing this issue. Anyone willing to work on a fix? :)