https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36049 Bug ID: 36049 Summary: Rounding prices sometimes leads to incorrect results Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P3 Component: Acquisitions Assignee: raphael.straub@kit.edu Reporter: raphael.straub@kit.edu QA Contact: testopia@bugs.koha-community.org CC: clemens.tubach@kit.edu, katrin.fischer@bsz-bw.de, michaela.sieber@kit.edu Example: Create an order line in acquisitions with vendor price 18.90 and a discount of 5 % results in a total (tax excl.) of 17.95. The correct value in the database (ecost_tax_excluded) is 17.955000 which should be rounded to 17.96. The problem is that all financial calculations in Perl and JavaScript are done with binary floating-point arithmetic instead of decimal arithmetic. For a short introduction to this topic see https://floating-point-gui.de. The solution is to use Math::BigFloat in Perl and bignumber.js (https://github.com/MikeMcl/bignumber.js) or big.js (https://github.com/MikeMcl/big.js) in JavaScript for every financial calculation. -- You are receiving this mail because: You are watching all bug changes.