Core concepts
Money
You send and receive a whole number of kobo with a currency beside it, and never a decimal.
How an amount looks
{ "amount": 1234567, "currency": "NGN" }
amount is a whole number of the currency's smallest unit. For naira that is kobo, so this is twelve thousand three hundred and forty five naira and sixty seven kobo.
You never send or receive a decimal point. Add one for display, on your side, at the last possible moment.
Why
A binary float can't hold a tenth exactly, so a total you assemble from decimals drifts from the sum of its parts. Across a payroll of ten thousand people that drift is a figure you have to explain.
A whole number of the smallest unit can't drift. Your bank counts the same way.
Rounding
Percentage deductions produce fractions of a kobo constantly. Eight per cent of ₦123,456.79 is 987,654.32 kobo, and there is no such thing as a third of a kobo.
Fractions live only in the working and are rounded once, at one declared point, by a named rule. Every payslip line you get carries the exact value before rounding, the policy applied and the result, so you can reconstruct a figure years later rather than defend it from memory.
A total is always the sum of its lines. It's never rounded on its own, so the two never disagree.
How many minor units
Naira has two, and not every currency does. Don't assume: read the exponent from the currencies endpoint, which publishes the minor unit for every currency we handle.
Never hard code a hundred.