[Koha-bugs] [Bug 13321] Tax and prices calculation need to be fixed

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jan 14 10:25:55 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13321

--- Comment #18 from Jonathan Druart <jonathan.druart at biblibre.com> ---
(In reply to Colin Campbell from comment #17)
> The real question is what we are doing with the values less than a cent?

Hum, what are the different choices? :)

> Remember also floats are not accurate. Financial apps that value accuracy
> convert the database value to an integer in cents and do all calculations on
> that then store it in a monetary form when saving it. That way any rounding
> is done predictably and it avoids errors arising from the approximation in
> how floats are stored and the inaccuracies in floating point arithmetic.

Yes, you are totally right, we should not use float. But I did not want to
change to many things.
It could be done later.

> If calculating a percentage for tax or discount purposes it needs to be
> calculated on the summed values, adding the individual values where they
> contain subdivisions of a cent are prone to error

The estimated cost (discounted) is calculated for 1 item, and the total is * by
the quantity.
On the contrary, the tax value should be correctly calculated.
I did not see any problem with the estimated cost so far.

Did you understand the purpose of the last patch (Fix unitprice rounding)?
Do you think it makes sense to fix the problem on this way?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list