Testing money: whole cents, tax and several currencies
Money has rules that plain numbers do not: whole cents, one rounding rule, tax on lines or on the total, and a different number of decimals for each currency.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a till receipt that is two pence out. A shop till rounds each line up by half a penny. The lines look fine. But the total at the bottom is two pence more than the real sum. No single line is wrong. The mistake comes from rounding many small parts.
Daily List is a to-do list app with a paid plan. Tom, the tester, checks the invoice. It has lines, a tax line and a total, and a customer may pay in another currency.
He learns three ideas. A is the smallest part of a currency that is used in amounts, such as the cent. A is a tiny error that appears when a computer stores a decimal fraction as a binary number. A currency code is the three-letter code that names a currency, such as USD.
Tom's job is to pick amounts that expose a wrong , a float slip or a wrong number of decimals. A few well-chosen amounts do more than many random ones.
The picture has a limit. A till receipt shows one rule at work. An invoice may follow different rules for tax, for each currency and for each country.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 2 in this section
- decimal
- a number with a dot, such as 2.5
- decimals
- digits written after the decimal point
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Choosing amounts that expose rounding, float slips and wrong decimals on an invoice, and checking lines, tax and total agree.
- Rule
- Edge amounts
- Exact sum
- Each currency
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| A till receipt | The invoice |
| Each line rounded under the declared currency rule | Per-line rounding |
| The total at the bottom | The invoice total |
| Pence and cents | The minor unit |
WHERE THIS PICTURE STOPS
- A till shows one rule. An invoice may follow different rules in each country.
- A receipt has one currency. An invoice may have several.
- A till rounds by eye. A computer rounds by a rule that must be agreed.
HOOK
Rule, edge amounts, exact sum, each currency.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
If an invoice has many small lines, test the total as well as each line. Rounding can add pence that no single line shows.
| In the trick | What it stands for |
|---|---|
| Each line | Per-line rounding, which looks fine alone |
| The total | The invoice total, which can be pence out |
If the invoice has one line, no rounding can build up across lines.
TELL A FRIEND
Line rounding and final rounding can legitimately differ; check which rule the invoice contract requires.
OFTEN MIXED UP WITH Testing rules and calculations. The rules and calculations lesson tests the arithmetic of a rule. This lesson adds the traps of money: rounding, float slips and decimals.
PRACTISE AND KEEP
Sources for this topic — 8 sources
- Market practice
What Every Programmer Should Know About Floating-Point Arithmetic (The Floating-Point Guide) ↗ — floating-point-gui.de · Binary floating-point cannot store decimals such as 0.1 exactly, and money is better held in a decimal type or in whole cents (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number found. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
decimal: Decimal fixed point and floating point arithmetic (Python documentation) ↗ — Python Software Foundation · Decimal numbers can be represented exactly, unlike binary floats; the module gives control over rounding; build a Decimal from a string, not from a float (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
CPython issue 83305 on the behaviour of round() (Python bug tracker) ↗ — Python Software Foundation (CPython issue tracker) · The note on round() says results for floats can be surprising because most decimal fractions cannot be stored exactly; round(2.675, 2) gives 2.67 (search excerpt of an issue page, live documentation not seen)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
ISO 4217 — Currency codes ↗ — International Organization for Standardization · Defines three-letter currency codes and the minor unit of each currency, which the lists in the standard give per currency (search excerpt, page not opened)
Search excerpts only, page not opened. The per-currency code and minor-unit values are maintained in the standard's own lists and are revised as currencies change; look a currency up in the current list rather than quoting a decimal count from memory. ISO makes the currency codes available free of charge, but the full standard text is a paid publication.
- Market practice
Why is the value added tax (VAT) amount not 20% of the invoice total? (ExpensePlus support) ↗ — ExpensePlus · Tax is usually worked out per line, so rounded line amounts can add up to a different figure than tax on the invoice total (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Choose the invoice rounding strategy (OfficeRnD help) ↗ — OfficeRnD · A product offers line-level rounding by default and total-level rounding as an alternative, and the two can differ by a cent on the same invoice (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Adyen — Currency codes and minor units ↗ — Adyen · A payment provider lists zero-decimal currencies such as JPY and three-decimal currencies such as BHD, and notes its table differs from the ISO 4217 list for a few currencies (search excerpt, page not opened)
Provider documentation retrieved through ordinary web search on the access date. Interview cases are original hypothetical extensions of candidate-reported gateway design themes. Locator: Minor units; Different number of digits after the point.
- Market practice
ISO 4217 currency lists: official maintenance agency ↗ — SIX Financial Information · Publisher material opened 6 November 2026; version and scope recorded in source registry and domain audit. Synthetic Daily List outcomes follow the stated teaching contract.
Official landing page opened 6 November 2026. Its List One XML was also read directly: published 2026-09-17, JPY minor-unit exponent 0 and BHD 3. XML URL: https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml. Full ISO standard not read.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.