Minor units. Money as whole numbers.
A small storage rule that keeps every balance exact to the last cent.
Definition
Minor units are the smallest unit a currency is counted in, such as cents for USD or EUR. Storing money as a whole number of minor units, 1250 rather than 12.50, keeps every sum exact, because computers handle whole numbers without rounding.
Why decimals cause trouble
Most programming languages store decimals as floating-point numbers, which cannot hold values such as 0.1 exactly. Add 0.1 and 0.2 and many systems return 0.30000000000000004. One such error is tiny. Across millions of stakes, wins and commission charges, tiny errors become balances that do not reconcile.
Whole numbers have no such problem. 10 plus 20 is always 30.
Examples by currency
| Currency | Decimal places | Amount | Stored as |
|---|---|---|---|
| USD | 2 | 12.50 | 1,250 |
| EUR | 2 | 0.99 | 99 |
| JPY | 0 | 1,500 | 1,500 |
| BTC | 8 | 0.0015 | 150,000 |
The number of decimal places belongs to the currency, so the platform knows how to display each stored amount. The smallest unit of bitcoin is called a satoshi.
Minor units on our platform
Every amount on the Arkstone platform is stored as whole minor units, from a player's balance to a commission charge, and every movement is a double-entry ledger entry. Calls from our casino aggregator API carry amounts the same way, so 500 means 5.00. Each currency runs as its own book, so a USDT amount is never added to a USD one. Whole units, plus idempotent calls to a seamless wallet, keep every casino round exact.
Related terms
- Double-entry ledger: where the whole-unit amounts are written.
- Idempotency: the rule that stops a retry paying twice.
- Seamless wallet: the casino wallet model that carries these amounts.
Minor unit questions
What is a minor unit of currency?
Its smallest counted part. For USD and EUR that is the cent, so one dollar is 100 minor units.
Why not store money as decimals?
Floating-point decimals can drift by tiny amounts when added up. Whole numbers add up exactly every time.
How are crypto amounts stored?
The same way, in each coin's smallest unit. For bitcoin that is the satoshi, one hundred-millionth of a coin.
Keep reading
See the whole platform on one call.
30 minutes, no slides. We walk you through the platform or the API you need, answer every question, and send a written price, often the same day.