Function convertAmountFromOnChainToHumanReadable

  • Amount is represented in the smallest unit format on chain, this function converts the smallest unit format to a human readable amount format

    Parameters

    • value: number

      The value in human readable format

    • decimal: number

      The token decimal

    Returns number

    The value is smallest units

    Example

    human readable amount format: 500
    on chain amount format when decimal is 8: 50000000000