Why does my invoice show 15.00 tax when my calculator says 14.9985?
Because nobody can pay a fraction of a halala. A riyal splits into a hundred halalas, so the tool rounds the tax to the nearest halala, with halves going up. 15% of 99.99 is exactly 14.9985, and the nearest halala to that is 15.00.
The maths, step by step
One product at 99.99 SAR, with 15 typed in the tax rate field. Inside the Basic invoice generator this happens:
- Line total: 1 x 99.99 = 99.99, nothing to round.
- Exact tax: 99.99 x 15% = 14.9985 SAR.
- The part beyond the halala is 0.85 of a halala, more than half, so it rounds to 15.00.
- Total: 99.99 + 15.00 = 114.99 SAR.
Your calculator was not wrong; it simply did not round. An invoice is a money document, and it has to end in an amount someone can actually pay.
How the tool avoids fraction errors
Many spreadsheets and apps work in floating-point decimals and occasionally produce oddities such as 0.30000000000000004. The tool sidesteps that: it turns every amount into a whole number of halalas, does the arithmetic on those, and rounds once at each step to the currency's smallest unit. That is why the on-screen summary and the PDF show exactly the same figure; both are built from the same calculation.
Where rounding happens on the invoice
- Each line is rounded on its own after quantity times price, then the lines are added.
- A percentage discount is rounded to the nearest halala.
- Tax is worked out once on the amount after discount, then rounded.
So tax is not worked out line by line. If another system you use rounds the tax on each line and then adds those up, it can differ from this tool by a halala or two on a long invoice. Which method your books should follow is a question for your accountant.
Checking the figure yourself
Open the VAT calculator, choose 'Add tax to a net amount', enter 99.99 with the same rate, and you will see the tax shown to two decimals. This rounding applies to two-decimal currencies. For the Bahraini or Kuwaiti dinar, or the Omani rial, the tool works to three decimals and rounds to the nearest fils instead.
Common questions
Can rounding cost me money?
Each step moves the figure by less than half a halala, and it can go in your favour or the client's depending on the numbers.
Can I switch rounding off?
No. Amounts are always shown and printed in the currency's smallest unit, because an invoice must end in a payable amount.
