Function unScaleToBase

  • unScale the given base number to base(bigint) unscale to the given decimals and drop the remaining decimals

    Parameters

    • value: string | bigint
    • decimals: number
    • newDecimals: number

    Returns bigint

    Example

    unScaleToBase(69000000000000000000n, 18, 6) // 69000000n
    unScaleToBase(69n, 0, 0) // 69n