I have to write a math calculation to exctract VAT from a gross amount, but I think many online calculator are missing some particular cases.
Let's say we have 10% of VAT and a gross amount of 5.00€ what is the net and vat amount? The rounding rules says that I have to round half up the 5th thousandth.
The standard formula would be:
net= 5 / (1 + 10 / 100)
net = 4,545454545454545
net (rounded) = 4.55
The problem is that: 4.55 + 10% = 5.01 and it exceeds the given gross amount
The previous cent has the opposite problem: 4.54 + 10% = 4.99 and it is less then the gross amount
So what is the right formula to exctract VAT?