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 rounding still have problems with inaccurate floating point arithmetic #884

Closed DokaRus closed 4 years ago

DokaRus commented 4 years ago

@rxaviers looks like #386 only solves the problem for positive numbers.

Globalizejs v.1.4.2 image

Related issues or PRs: #386 #856

rxaviers commented 4 years ago

The problem fixed by #386 is related to inaccurate floating point arithmetics, which doesn't happen here. The results posted here are correct. Note you can change the rounding mode if needed via options.round.