Skip to content
On this page

parseEther

Converts a string representation of ether to numerical wei.

Import

ts
import { parseEther } from 'viem/utils'

Usage

ts
import { parseEther } from 'viem/utils'

parseEther('420') 
// 420000000000000000000n

Returns

bigint

Parameters

value

  • Type: string

The string representation of ether.

Released under the MIT License.