Skip to content

Instantly share code, notes, and snippets.

@changwu-tw
Created February 5, 2017 16:30
Show Gist options
  • Save changwu-tw/24bafafa720c438abe65651284570e2d to your computer and use it in GitHub Desktop.
Save changwu-tw/24bafafa720c438abe65651284570e2d to your computer and use it in GitHub Desktop.
單位換算
> web3.toWei(20, 'gwei')
'20000000000'
> web3.toWei(20, 'gwei') * 21000
420000000000000
> web3.fromWei(web3.toWei(20, 'gwei') * 21000, 'ether')
'0.00042'
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment