Function toMAS

  • Convert any value expressed in nanoMassa back to Massa. This function takes an input value in nanoMassa and returns the equivalent value in Massa.

    Parameters

    • amountInNanoMassa: string | number | bigint | BigNumber

      The amount to convert, expressed in nanoMassa. Can be a number, string, BigNumber, or bigint.

    Returns BigNumber

    The amount expressed in Massa, as a BigNumber.

    Remarks

    Massa is a unit of currency and nanoMassa is a sub-unit, where 1 Massa equals 10^9 nanoMassa. This function uses the BigNumber library to perform calculations with arbitrary precision.

    Example

    const massa = toMAS(1000000000n); // returns new BigNumber(1)
    

Generated using TypeDoc