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.95k stars 528 forks source link

Rounding errors with larger numbers. #94

Open ghost opened 9 years ago

ghost commented 9 years ago

Screenshot taken from the project demo page speaks for itself.

accounting-js-rounding

elekktrisch commented 8 years ago

accountingjs is based on the javascript number type which is floating-point. So there is no way to fix this except for rewriting everything to BigDecimal. One attempt for that is here: https://github.com/elekktrisch/stutzjs