I created own token with 1000000(1 million) total supply, with 18 decimals. When I check _totalSupply in remix it returns 1000000000000000000000000. How is this number converted?
When we have a contract that we want to move some tokens from one account to another which number decimals do we have to use? 1000000000000000000000000 or can we simplify if I want to move 100 tokens?
In truffle I used _totalSupply call to get total supply and it gives me big number.
truffle(bracknell)> rofl._totalSupply.call()
BigNumber { s: 1, e: 24, c: [ 10000000000 ] }
Then I used following to get total supply in human friendly display:
truffle(bracknell)> rofl._totalSupply.call().then(function(balance){console.log(web3.fromWei(balance.toNumber(), "ether")); console.log(balance.toNumber() / Math.pow(10, 18)); })
1000000
1000000
It shows in human friendly, but which number do we use for transfer? I guess big number, in that case what is the easiest way to convert this if we pass for example 100 tokens in function to move them?