Blog ·
Who gets the last cent?
Everyone knows not to store money in a float. Fewer systems have decided what happens to the last cent — which is where the actual arguments come from.

Everyone knows not to store money in a floating point number. Fewer systems have decided what happens to the last cent — which is where the actual arguments come from.
Decimal types are table stakes. The interesting decisions come after:
The four decisions
Scale. Two decimal places for amounts, but unit prices often need more — and taxes computed on rounded prices give different totals than taxes computed first. That’s a business rule, not a preference.
Where you round in a chain. Price times quantity, minus discount, plus tax, times exchange rate. Rounding at each step and rounding at the end produce different numbers — and both are defensible until someone reconciles them against another system.
Direction. Half-up is the common default and it isn’t universal: some jurisdictions and some contracts specify otherwise.
Distribution. Splitting 100 across three instalments gives 33.33 three times and a cent left over. Someone gets it. Deciding who — first instalment, last one, spread — is a decision; and if it isn’t made explicitly, it’s made accidentally by whatever the loop does.
That last one is where I’ve seen real disputes. Because the difference is a cent, but the argument is about whether the system can be trusted.
The practical habit
Any calculation that produces money gets a test with the awkward numbers, not the round ones: amounts that don’t divide evenly, discounts that produce thirds, rates with many decimals. Round numbers pass every implementation — including the wrong ones.
And the rounding rules get written down where the calculation lives. They’re requirements, and they’re the ones nobody thinks to state.