Calculation of item sub total - 5 x 1 = 6

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
We have come accross a strange behaviour, which we have already tracked down in the source. But we are somewhat reluctant in changing this part of the code. Any thoughts on this are welcome.

We have a nop setup where prices are entered excl. VAT.

There's a product that costs 9,91 excl. VAT and the tax that should be added is 6%.

If a customer adds ONE of these products to the shopping cart, the item shows a total of:
(9,91 x 1) + 6% = (9,91 x 1) + (0,5946) = 10,5046 = 10,50 (rounded)

But when a customer adds FIVE:
(9,91 x 5) + 6% = (9,91 x 5) + (2,973) = 52,523 = 52,52 (rounded; there's a two cents rounding issue)

In our opinion, this should be different, since a customer should see:
10,50 x 5 = 52,50

To solve this, we can change the source to make sure that the item sub totals are calculated on the item unit price including VAT and then multiplied by the quantity.
But... what impact does this have on other parts of the app?

Any thoughts are welcome.
13 лет назад
Having worked in retail a lot, I can tell you that rounding is a pain for just about any software, and will usually error in favor of the seller not the buyer. I would rather overcharge 2 cents than worry about whether I'm getting enough from my customer.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.