jklepatch / eattheblocks

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

Home Page:https://eattheblocks.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

iamasoliddev opened this issue · 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