I wrote my erc20 token by solidity and the decimals of token is 18.
I'm testing the smart contract on truffle and one thing that I noticed was the octal number is returned when I called the balanceOf()
function.
I want to check the balance of accounts as decimals which is fixed as 18.
For example, I want to transfer the 1.001
or 22.0000003
and then get the return value of balanceOf()
as 23.0010003
.
However, this is the result I got.
> cc.transfer(user1, 000000000000000100, {from: owner})
{ [String: '512'] s: 1, e: 2, c: [ 512 ] }
How can I transfer or check the balance as fixed 18 Decimals not the octal number? Please help!