Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
iamasoliddev opened this issue Mar 29, 2021 · 1 comment

Comments

@iamasoliddev
Copy link

iamasoliddev commented Mar 29, 2021

Hello,

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.

Thanks!

@iamasoliddev
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant