decimals is how many places after the decimal point you want your token to support.
For example, suppose I'm creating a token called "dollars," and I want people to be able to transfer an amount like $1.25. To support that, I'll use a decimals value of 2. Because Solidity only supports integers (no decimal points), inside the contract I'll need to keep track of how many pennies everyone has, not actually dollars. So instead of me sending $1.25, I'll be sending 125¢.
If I want to start out with $1,000,000 in my contract, I'll need to multiply that by 100 to get the number of cents. So initialSupply = 1,000,000, decimals = 2, and thus totalSupply = 1,000,000 * 10**2 = 1,000,000 * 100 = 100,000,000. An initialSupply of $1,000,000 became a totalSupply of 100,000,000¢.
(10**2 means 10 raised to the power of 2.)
If you don't want to support any digits after the decimal point, you can simply set decimals to 0. Note that 10**0 == 1, so you'll just be multiplying by 1, and initalSupply and totalSupply will both be the same.
So iv decided to burn 1 with 14 zeroes following it.
Result? https://i.gyazo.com/fe372ac50d3b94c24ed78c79bbacedaa.png
It still has 18 zeroes but this time its 9999 then 18 zeroes.
Can you explain me how much is total supply of my token
– Uros Tadic Oct 23 '17 at 21:27I burn the token by going to admin page and selecting burn function, then i wrote amount I wanted to burn. After transaction was done, I came back to admin page and total supply looks even bigger, 18 zeroes still but 9999 in front instead of 1.
If you could just let me know what parameters I have to write to get total supply of 1 mil with code im using, that would be awesome.
– Uros Tadic Oct 24 '17 at 09:31initialSupplyof 1 million (1000000) to the constructor, then you'll have one million coins. Note that the value oftotalSupplywill be 1000000 followed by 18 zeroes, since the value ofdecimalsis 18. (As I explained above, this is so you can transfer fractions of coins. If you prefer to disallow that, just use1as the value fordecimals.) – user19510 Oct 24 '17 at 10:02