royNiladri / js-big-decimal

Work with large numbers on the client side with high precision.
https://www.npmjs.com/package/js-big-decimal
MIT License
156 stars 28 forks source link

Floor returns negative 0 #24

Closed martin-aliverti closed 4 years ago

martin-aliverti commented 4 years ago
const bigValue = new bigDecimal(0.00001341);
const integer = bigValue.floor();

integer is now -0, instead of 0

Besides the issue, the intent is to obtain the integer part of the number. Is there a better way to achieve that?

royNiladri commented 4 years ago

Please check with the latest patch v1.2.3. Sorry for the delay in the fix.