TOPIC 36/5115 MINNOT STARTED

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.

  1. Rule
  2. Edge amounts
  3. Exact sum
  4. Each currency
Four checks

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
A till receiptThe invoice
Each line rounded under the declared currency rulePer-line rounding
The total at the bottomThe invoice total
Pence and centsThe 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.

What each part of the trick stands for
In the trickWhat it stands for
Each linePer-line rounding, which looks fine alone
The totalThe 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
  1. 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)

    Free to read. Explains that binary floating-point cannot store decimals such as 0.1 exactly, and that money is better held in a decimal type or in whole cents. Cite for that point only. · Checked 2026-10-18

    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.

  2. 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)

    Per the search excerpt, decimal numbers can be represented exactly, unlike binary floats. The module keeps trailing zeros, which suits money, and gives the programmer control over rounding. Build a Decimal from a string, not from a float. · Checked 2026-10-18

    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.

  3. 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)

    Per the search excerpt, the built-in round() note says the result for floats can be surprising because most decimal fractions cannot be stored exactly; round(2.675, 2) gives 2.67. The excerpt names the decimal module as the way out. The live documentation page was not returned. Practitioner guidance, not a standard. · Checked 2026-10-18

    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.

  4. 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)

    Defines the three-letter and three-digit codes for currencies and funds, and — for currencies that have one — the relationship between a currency and its minor unit. It is the authority behind the currency attribute and the permitted number of decimal places on every ISO 20022 amount element. · Checked 2026-08-03

    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.

  5. 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)

    Per the search excerpt, tax is usually worked out per line, so rounded line amounts can add up to a different figure than tax on the invoice total. Practitioner guidance, not a standard. · Checked 2026-10-18

    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.

  6. 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)

    Per the search excerpt, 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. Practitioner guidance, not a standard. · Checked 2026-10-18

    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.

  7. 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-specific amount encoding and the Terminal API exception; not an amendment to ISO 4217. · Checked 2026-09-25

    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.

  8. 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.

    Currency-code and minor-unit exponent lists. JPY uses exponent 0 and BHD 3; interface representations must also be checked. · Checked 2026-11-06

    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.