I’m using Order checkout api and I noticed that one of my taxes did not round up to the next penny as it should.
The subtotal is 355.70 and the tax rate is 5%, giving a tax amount of 17.785. It should round up to 17.79 but it shows 17.78
This is the item list:
1 × item#1 ($19.95)
5 × item#2 ($199.75)
1 × item#3 ($14.95)
1 × item#4 ($99.95)
1 × item#5 ($21.10)
Any idea why it doesn’t round up?
The Orders API performs its calculations using Bankers’ Rounding, also known as Rounding Half to Even. Under Common Rounding rules (Round Half Up), half-values round up to the next closest integer. However, under Bankers’ Rounding, half-values round to the closest even integer. This has the effect of rounding even numbers down, while leaving odd numbers unchanged.
Ok that explains it, thought it was a bug.
Is there a way to enforce Common Rounding rules? If not, what can I do since other systems my client’s business have uses Common rounding.
Unfortunately at this time there isn’t any way to enforce any other rounding logic at this time.