Tax rounding wrong with shipping
-
Hi! I just noticed the following problem. Here we have to calculate taxes not line by line but from the subtotal and only then round. I have checked the appropriate box in the woocommerce settings.
However, I have just noticed that the shipping is still calculated separately and not as part of the subtotal. This leads to wrong rounding in many cases. E.g. the products cost 5.90 + 4.90 shipping. In this example all the products have the same tax class of 10% included so 10% applies to shipping too.
5.90 + 4.90=10.80 / 11 = 0.9818… tax rounded to 0.98. This is how it’s supposed to be with calculating tax at the subtotal level.
However, woocommerce does this:
5.90 / 11 = 0.5363… rounded to 0.54
4.90 / 11 = 0.4454… rounded to 0.45
0.54 + 0.45 = 0.99 which is 0.01 too many.How can I fix this? Thanks!
- The topic ‘Tax rounding wrong with shipping’ is closed to new replies.