VAT/TAX Rounding error - Important fix

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Take a product priced £3.39 ex, 3.98 inc.

3.39 * 1000 = £3390 + vat = £3983.25
3.98 * 1000 =                       £3980.00

Which one is correct? Well actually the second one is, but nopcommerce calculates the top way.

The problem occurs because 3.39 + 17.5% is not 3.98, its 3.98325.

This has caused major issues with some of our sites.

I have identified this issue in version 1.7, has it been fixed in later releases?

Solution is to only round prices after the final calculation is made to display to the customer. behind the scenes we should be calculating to at least 4 decimal places.
13 years ago
price = Math.Round(price, 2);

I think the fix to this is simply remove the above - only rounding when printing to screen.
12 years ago
I've got the same problem and I also removed this value:

shoppingscartservice.cs - GetShoppingCartSubTotal - taxValue = Math.Round(taxValue, 2);
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.