Skip to main content

fromWei

Callable

  • fromWei(number: Numbers, unit: noether | wei | kwei | Kwei | babbage | femtoether | mwei | Mwei | lovelace | picoether | gwei | Gwei | shannon | nanoether | nano | szabo | microether | micro | finney | milliether | milli | ether | kether | grand | mether | gether | tether): string

  • Takes a number of wei and converts it to any other ether unit.

    @example
    console.log(web3.utils.fromWei("1", "ether"));
    > 0.000000000000000001

    console.log(web3.utils.fromWei("1", "shannon"));
    > 0.000000001

    Parameters

    • number: Numbers

      The value in wei

    • unit: noether | wei | kwei | Kwei | babbage | femtoether | mwei | Mwei | lovelace | picoether | gwei | Gwei | shannon | nanoether | nano | szabo | microether | micro | finney | milliether | milli | ether | kether | grand | mether | gether | tether

      The unit to convert to

    Returns string

    • Returns the converted value in the given unit