I saw token decimal has different value like 12, 10, 6 in different substrate chain, What exactly it means and what is the use of it?
This is the number of decimals on your main token. Compare with fiat currencies a euro has a decimal value of
2 and a cup of coffee is 0.99 Euro, while in Japan a Japanese yen (for all practical use) has a decimal value of
0 and a cup of coffee is 120 yen.
On a chain all currencies are a huge integer number, but since that is confusing for humans, these integers are treated as a fix point decimal number system instead.
Calling the RPC
system.properties will reveal this information for any chain. For instance polkadot as 10
1 DOT is represented internally by
When encoding operations on the chain values are given in the internal u128 integer format, any tool communication with the chain should do this conversion for the user.