Nanoton, GRAM and nine decimals

Every amount on TON is an integer. A liteserver, an API or a get-method never returns "1.5 GRAM"; it returns 1500000000, the number of nanoton, and the client decides how to display it. One GRAM — the renamed native coin of TON, formerly called Toncoin; the network itself is still TON — is 10⁹ nanoton, so the display amount is the integer with the decimal point moved nine places to the left:

Text
1 GRAM          = 1 000 000 000 nanoton
0.000000001 GRAM = 1 nanoton
1e9 GRAM         = 1 000 000 000 000 000 000 nanoton

The converter does exactly that and nothing else: it moves a decimal point. There is no exchange rate here and no on-chain lookup.

Why the tool refuses to use floats

A JavaScript number is a 64-bit float. It represents integers exactly only up to 2⁵³, about 9.007 × 10¹⁵ — roughly 9 million GRAM in nanoton — and it cannot represent most decimal fractions at all: 0.1 + 0.2 is 0.30000000000000004. Dividing a balance by 1e9 and multiplying it back is therefore a lossy round trip, and an amount that is off by one nanoton is still a wrong amount in a transaction.

Everything on this page is BigInt arithmetic on decimal strings. A value that cannot be represented in the unit's decimals — 0.0000000001 GRAM, a tenth of a nanoton — is an error, never a rounding. Scientific notation is handled the same way: 1e9 is one billion, 2.5e-3 is 0.0025, both exact.

Jettons and decimals

A jetton amount is also an integer, in the jetton's own base unit. How many base units make one display unit is the jetton's decimals, published in its metadata — the content cell returned by the master contract's get_jetton_data get-method — under the key decimals. When the key is absent the standard (TEP-64) says 9.

USDT on TON uses 6, like USDT on other chains: 1 USDT is 1000000 raw units. Sending 1000000000 because you assumed nine decimals sends 1,000 USDT, which is the single most common unit mistake on the network. The presets cover USDT and the generic nine; the decimals field takes any value from 0 to 30 for a jetton you are looking at.

This version does not read decimals from the chain. If you do not know them, read the jetton's metadata through a liteserver or an explorer before you trust a number here.

Input the converter accepts

Digits with one decimal point or one decimal comma (1,5), thousands separators as spaces, underscores or commas when a point is present (1 000.25, 1,000,000.5), a leading +, and an exponent (1e9, 2.5E-3). Negative amounts are refused. The output is the plain integer or decimal, plus a grouped version for reading.