Skip to content

fromWei/toWei equivalents #2

@ricmoo

Description

@ricmoo

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions