openexchangerates / accounting.js

A lightweight JavaScript library for number, money and currency formatting - fully localisable, zero dependencies.
http://openexchangerates.github.io/accounting.js
MIT License
4.96k stars 530 forks source link

precision handling strange results #145

Closed radisb closed 7 years ago

radisb commented 8 years ago

Hello, is this normal? (rounding is not uniform across the set)

EBMike commented 8 years ago

Its whats called a hole in the floating point line.

same happens here: 8.325 * 100 => 832.4999999999999

which in turns rounds to: 832

and then: 832 / 100 => 8.32 (which is clearly wrong)

EDIT: I added a pull request which I think will fix this

EBMike commented 7 years ago

I'm starting to doubt anybody is monitoring these issues since the last issue closed was Dec 2015

manfredjb commented 7 years ago

This project looks abandoned. This is a nice project.

wjcrowcroft commented 7 years ago

Fixed by #164.