# Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

## Magento Forum

Page 1 of 8
CRITICAL: Tax Calculation Flaw in All Versions of Magento
 Gui   Total Posts:  588 Joined:  2008-03-09 To answer your question first. Your client is correct, you should not round sub-totals always round the total number. Why? Well you showed that part This is basic math actually (no offense) and has nothing to do with sales tax, although governments can make it difficult, this not one of those things. However this leads to the conclusion that there must be a flaw in the Magento system on this point. I know there are several Issues reported and those are assigned. My guess is it has everything to do with the rounding out or rounding out and not passing along enough digits. In order to make that clear I have made a small table using your values. ``` Value    Tax    2 digits    3 digits    4 digits    5 digits                                      7.95      0.0825      0.66     0.656      0.6559     0.65588          7.95      0.0825      0.66     0.656      0.6559     0.65588          7.95      0.0825      0.66     0.656      0.6559     0.65588          7.50      0.0825      0.62     0.619      0.6188     0.61875          7.50      0.0825      0.62     0.619      0.6188     0.61875          5.00      0.0825      0.41     0.413      0.4125     0.41250          5.00      0.0825      0.41     0.413      0.4125     0.41250        30.00     0.0825     2.48    2.475     2.4750        2.47500        16.50     0.0825     1.36    1.361     1.3613        1.36125          8.00      0.0825      0.66     0.660      0.6600      0.66000         22.00     0.0825     1.82    1.815     1.8150        1.81500                                     125.35000      10.34138      10.36      10.343      10.3416      10.34139         SUM ``` Hopefully this comes across. If it is a bit messed up, look at the last row (SUM). The first amount is the Total order and the second amount is the total tax calculated from the Total order. The others are Sums from the x-digits formats. As you can see only the 5-digit sum gets the closed to the tax calculated from the total order. The solution is simple. Pass along all values with 5-digits. You could also do it with four, that is the minimum, but then you still will have differences from time to time. With five it is almost not existent. If this is easy to implement is a second I hope that cleared up some of the mystery. Posted: October 16 2008    |  top  |  # 1
 brax   Total Posts:  17 Joined:  2008-11-06 Hello, i have the same problem. I am using Magento 1.1.7. Is there a fix by now? Furthermore i have the following curios case: I’ve created a product with the price 2,86 â‚¬ (excl. tax). The product-price is announced in the frontend incl. tax (19%). So far so good. But if i choosed two articles of the same product, the cart shows me instead 3,40 â‚¬ the wrong price 3,41 â‚¬. This appears only when i choose two articles. Have this the same reason (round-function) like above? Posted: November 24 2008    |  top  |  # 2
 brax   Total Posts:  17 Joined:  2008-11-06 I did not make a bug-report. Posted: November 26 2008    |  top  |  # 3
 Gui   Total Posts:  588 Joined:  2008-03-09 http://www.magentocommerce.com/bug-tracking/issue?issue=3043 edit that is #6858 Posted: November 26 2008    |  top  |  # 4
 dakman   Total Posts:  38 Joined:  2008-07-09 I believe we are close to fixing this… Gui i made a new rounding function in /app/code/core/Mage/Core/Model/Store.php and changed the way tax is being rounded (per item) in app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php but we are testing it in a real scenario on our dev site.. I’ll let you know our results shortly.. Posted: November 26 2008    |  top  |  # 5
 bytestorm   Total Posts:  91 Joined:  2008-04-02 actually we have plans to change the rounding methods in future magento versions (not only taxes) Posted: November 27 2008    |  top  |  # 6
 Gui   Total Posts:  588 Joined:  2008-03-09 @bytestorm Good to hear.  Not before 2.0 I presume? @dakman I do believe that is a good start solution but I think the problem runs much deeper. However I am looking forward to see what you come up with. Posted: November 27 2008    |  top  |  # 7
 jedimastafez   Total Posts:  45 Joined:  2008-01-22 Bucklands Beach Gui - 26 November 2008 02:27 AMhttp://www.magentocommerce.com/bug-tracking/issue?issue=3043 edit that is #6858 How and where do you actually change the rounding from four to five? I am having the same problem with GST calculation in New Zealand.... Posted: January 5 2009    |  top  |  # 8
 paulpemby   Total Posts:  17 Joined:  2008-12-13 Are there any developments on this issue. I only noticed it when I set up a test product with a value of Â£0.01. When you purchase a quantity of this item the tax is still calculated on at an individual level so no tax gets added to the row. Posted: January 28 2009    |  top  |  # 9
 jedimastafez   Total Posts:  45 Joined:  2008-01-22 Bucklands Beach I had hoped the upgrade to 1.2.1 would resolve this but it still hasnt. Can this please be looked at as its becoming quite critical to a lot of our clients. Posted: February 18 2009    |  top  |  # 10
 dakman   Total Posts:  38 Joined:  2008-07-09 Been sooo swamped havent had a chance to dive into this. This has been on my mind lately and I want to get around to fixing it but I really need the community/magento’s help on this one.. This is a complicated fix because it doesnt just effect the way taxes are calculated but discounts as well.. but YES THIS IS a critical issue.. Posted: February 18 2009    |  top  |  # 11
 primeminister   Total Posts:  4 Joined:  2009-02-26 He! Any updates on this issue? I’ve seen some updates but still doesn’t work when I order two of the same products. Posted: February 26 2009    |  top  |  # 12
 jedimastafez   Total Posts:  45 Joined:  2008-01-22 Bucklands Beach Which version are you on?  1.2.1.1 states: Fixed Bugs * Fixed shopping cart row total including tax Can anyone confirm that this corrects our problem here? Posted: February 26 2009    |  top  |  # 13
 primeminister   Total Posts:  4 Joined:  2009-02-26 I have upgraded from 1.2 to 1.2.1.1 with the diff files. I can confirm that it doesn’t correct my problem. When ordering two of the same products the rounding with tax is gives me trouble with the iDEAL payment that the total amount is not correct. (one cent short) Posted: February 27 2009    |  top  |  # 14
 jedimastafez   Total Posts:  45 Joined:  2008-01-22 Bucklands Beach Can you post a screenshot of your example?  Im not quite understanding your issue in comparison to ours. Posted: March 1 2009    |  top  |  # 15
 Page 1 of 8 < Prev123Next >Last »