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

fromWei/toWei equivalents #2

Closed
ricmoo opened this issue Jul 29, 2016 · 1 comment
Closed

fromWei/toWei equivalents #2

ricmoo opened this issue Jul 29, 2016 · 1 comment

Comments

@ricmoo
Copy link
Member

ricmoo commented Jul 29, 2016

We need to be able to convert to/from wei/ether. I will likely copy most of the functionality from the existing ethers.io formatEther.

  • formatEther(weiAsBnOrHex, options) => decimalString
  • parseEther(stringAsDecimalOrNumber) => BN

Options:

  • round: 'up' | 'down' | 'round' | 'none' (default: none)
  • decimals: Number (default: 18)
  • commify: true | false (default: false)
@ricmoo
Copy link
Member Author

ricmoo commented Aug 2, 2016

Done, with some slight adjustments to the options available.

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