Decimals and the step
You are looking at an old version of this page: revision #85 by zoobc.how, 2026-10-26 20:39 UTC. See the current version
Every balance on ZooBC, of ZBC or of any token, is counted in the same atomic unit: one hundred-millionth (10⁻⁸). A token's decimals, a number from 0 to 8 chosen when it is issued, do not change that unit. They say how many of the eight decimal places the token uses, and therefore the smallest amount of it that can move.
The step
Every amount that moves a token must be a whole multiple of its step:
step = 10^(8 − decimals) atomic units
The token's total supply must be a multiple of the step too. An amount finer than the step is refused.
| Decimals | Step, in atomic units | Smallest amount |
|---|---|---|
| 0 | 100,000,000 | 1 |
| 1 | 10,000,000 | 0.1 |
| 2 | 1,000,000 | 0.01 |
| 3 | 100,000 | 0.001 |
| 4 | 10,000 | 0.0001 |
| 5 | 1,000 | 0.00001 |
| 6 | 100 | 0.000001 |
| 7 | 10 | 0.0000001 |
| 8 | 1 | 0.00000001 |
Whole units and fine units
Because the atomic unit never changes, one whole token is always 100,000,000 atomic units, whatever its decimals. A wallet converts what a person types into atomic units: 12.5 tokens is 1,250,000,000 atomic units, a valid amount for any token with at least 1 decimal.
The decimals therefore describe how finely a token can be divided:
- a token with 0 decimals moves only in whole units, like tickets or seats;
- a token with 8 decimals moves down to 0.00000001, like ZBC.
The fourteen genesis coins all have 8 decimals.
Where decimals matter
- Order-book markets accept only tokens that use all 8 decimals: both assets of a market's pair need 8 (see markets and orders).
- Swap offers accept any decimals (see swap offers), so a token with fewer decimals trades there.
- A fee paid in the token gives up units rounded up to the token's step (see issuing a token).
So an issuer who wants the token traded on an order book chooses 8 decimals at issue.