ethers.js/docs/v5/api/utils/display-logic
2020-06-11 16:29:05 -04:00
..
index.html Organizing versioned docs. 2020-06-11 16:29:05 -04:00
README.md Check-in old v5 docs changes. 2020-06-09 23:56:58 -04:00

Documentation: html

Display Logic and Input

Units

Decimal Count

Named Units

Functions

Formatting

ethers . utils . commify( value ) => string

Returns a string with value grouped by 3 digits, separated by ,.

Conversion

ethers . utils . formatUnits( value [ , unit = "ether" ] ) => string

Returns a string representation of value formatted with unit digits (if it is a number) or to the unit specified (if a string).

ethers . utils . formatEther( value ) => string

The equivalent to calling formatUnits(value, "ether").

ethers . utils . parseUnits( value [ , unit = "ether" ] ) => BigNumber

Returns a BigNumber representation of value, parsed with unit digits (if it is a number) or from the unit specified (if a string).

ethers . utils . parseEther( value ) => BigNumber

The equivalent to calling parseUnits(value, "ether").