Too many decimal places shown when displaying a computed float
For some combinations of quantities and cost prices the sums shown at the bottom of the Products by Location
have floating point rounding errors, for example they show 0.30000000000000004
instead of 0.3
(or 0.3000
).
Steps to reproduce, from a clean installation (6.0 & trunk):
- Activate stock module
- Add "Test" company when prompted
- Create "Product 1" - cost_price
0.01
, unitsUnit
- Create "Product 2" - cost_price
0.02
, unitsUnit
- Create and do moves:
Supplier
->Storage Zone
:-
10
units of "Product 1" (unit price 0.01)-
10
units of "Product 2" (unit price 0.02)
-
-
- Open
Inventory and Stock > Locations
select theWarehouse
and open theProducts by Locations
related records
In sao the cost value sum at the bottom of the list shows 0.1 / 0.30000000000000004
(or if both lines are selected 0.30000000000000004 / 0.30000000000000004
).
In tryton the cost value sum at the bottom of the screen shows 0.1000 / 0.3000
(or 0.3000 / 0.3000
).