Skip to content

weiToEther

weiToEther(weiQuantity): string

Defined in: utils/wei-to-ether.ts:20

Convert from Wei to Ether

Similar to “formatEther” in ethers.js

Similar to “fromWei” in web3.js

Parameters

weiQuantity

the amount of wei to convert to ether

string | number | bigint

Returns

string

a string decimal representation of ether equivalent to the specified wei

Example

weiToEther('1000000000000000000000')
// '1000'
weiToEther(1000000000000000000000)
// '1000'