@chromia/ft4 - v2.1.0
    Preparing search index...

    Function createAmount

    • Returns a new asset amount.

      Parameters

      • num: SupportedNumber

        The desired value for the amount.

      • Optionaldecimals: number

        The desired number of decimal digits.

      Returns Amount

      An asset amount with the specified value, and decimal digits added to it if needed. Be careful with blockchain return values! They are generally represented as big integers, removing the decimal point. If you want to use (num: 1000, decimals: 3) to represent 1.000, you should use createAmountFromBalance(1000, 3) instead.

      createAmount(1, 2) // returns 1.00
      createAmount("1", 2) // returns 1.00