Skip to content
On this page

parseUnit

Multiplies a string representation of a number by a given exponent of base 10 (10exponent).

Import

ts
import { parseUnit } from 'viem'

Usage

ts
import { parseUnit } from 'viem'

parseUnit('420', 9) 
// 420000000000n

Returns

bigint

Parameters

value

  • Type: string

The string representation of the number to multiply.

exponent

  • Type: number

The exponent.

Released under the MIT License.