Price rounding
-
Hi,
On github i posted a question about the issue of woocommerce not rounding the prices in proper way. Bellow it is the description of the issue.
Example of issue:
Product: 1.99€ (this already includes tax calculation)If i add this to cart and say i want 5 pieces of this product the expected price would be: 9.95€, but the cart actually outputs: 9.94€ which is not fine. I did manualy calculation and it makes sesnse why this number comes out as mentioned the system is calculating everything on 4 decimals.
That would mean:Net price of product: 1.63
22% tax: 0.3586
Total price display: 1.99 as sytem calculates 1.9886 and rounds it up to 1.99
But then it also calculates the quantity by price 1.9886 instead of 1.99, why ?So 2×1.9886 = 3.9772€ and round to 3.98€ which is same as 2×1.99 = 3.98
But on different prices the different quantity doesn’t work, for example:
5×1.9886 = 9,943 and it rounds to disply price 9.94€, now if you take 5×1.99 the price should be 9.95€.Is it somehow possible to force the whole system to only work with 2 or 3 decimals, like the display option ?
How can i resolve this issue in system ? Thanks in advance.The page I need help with: [log in to see the link]
- The topic ‘Price rounding’ is closed to new replies.