John Karanja

The field guide · rule 06 of 16

Store money in whole numbers, and make the books balance

Never store money in a way that rounds. Use whole cents, and write down the rule that must always hold.

What it means

Computers store some decimal numbers with tiny rounding errors, and these add up. Store money as whole numbers of the smallest unit, such as cents or satoshis, or use exact decimals. Then write down the rule that must always be true, such as "money in equals money out plus what is still owed", and have the system check it automatically.

What goes wrong without it

Small rounding errors pile up until the totals no longer match the bank, and nobody can say where the difference went.

How I build it

From systems I build and run.

Ask your team

  1. Is money stored in whole units or exact decimals, never in a way that rounds?
  2. Is there a written rule that the totals must always meet?
  3. Does anything check that rule automatically?

A "no" or "not sure" is worth a closer look.

How a review checks this

The payments check reconciles a sample of records against their source and tests the balance rule itself.

Request a reviewThe offer: Payments and ledger integrity checkCheck your system in one minute

Related rules