jklepatch / eattheblocks

Source code for Eat The Blocks, a screencast for Ethereum Dapp Developers

Home Page:https://eattheblocks.com

Github PK Tool:Github PK Tool

Repository from Github https://github.com/jklepatch/eattheblocksRepository from Github https://github.com/jklepatch/eattheblocks

const amountIn = ethers.utils.parseUnits('0.01', 'ether') gives amountIn = 10000000000000000

iamasoliddev opened this issue · 1 comments


I'm trying to understand what's happening here...

when I declare a variable and call parseUnits:

const amountIn = ethers.utils.parseUnits('0.01', 'ether')

the result is:

tokenIn: 10000000000000000

Do you know why it is 10000000000000000 ?

Please help.


OK I got it ... :)
1 Ether = 1,000,000,000,000,000,000 wei