Function parseUnits

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

    This code snippet is taken from the Viem SDK.

    Parameters

    • value: string
    • decimals: number

    Returns bigint

    Example

    import { parseUnits } from 'viem'

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