ERC20 token standards have a variable call decimals but all its functions parameters are uint256, how can I send tokens in decimals. Ex: 0.01 MFT (MyFirstToken)
Asked
Active
Viewed 839 times
1
-
Or: Decimals on ERC-20 tokens – Richard Horrocks Jan 06 '18 at 20:48
-
According to the second link that you shared, there are no actual decimal values? Just integers? – Kashish Khullar Jan 06 '18 at 20:54
-
1@KashishKhullar yep, thats why Ether has Wei as the smallest unit. Because if the price of Ether will skyrocket we still have 18 decimal places to play around with a smaller units. There are tokens like IOTA which are very small and to trade real values with them the IOTa system of units was made. You can make such system for your own Token. – Roman Frolov Jan 08 '18 at 15:19
1 Answers
3
There is no such thing as a floating point number in Ethereum. Everything is a 'wei'. An ether is 10^18 wei. The decimals value in the token standard is an indication to wallets and other tools that handle ERC20 tokens instructing them how best to display the token.
Thomas Jay Rush
- 9,943
- 4
- 31
- 72