Amount

public class Amount : CustomStringConvertible

Contains the amount for transactions. The amount can be specified in minor units as integer value or in major units as floating point value.

  • Create amount using minor units.

    Declaration

    Swift

    public init(amount: Int, currency: CCurrency)
  • Create amount using minor units.

    Declaration

    Swift

    public init(amount: Int, currency: CCurrency, exponent: Int) throws
  • Create amount using minor units.

    Declaration

    Swift

    public init(amount: Int64, currency: CCurrency)
  • Create amount using minor units.

    Declaration

    Swift

    public init(amount: Int64, currency: CCurrency, exponent: Int) throws
  • Create amount using major units.

    Declaration

    Swift

    public init(amount: Double, currency: CCurrency)
  • Create amount using major units.

    Declaration

    Swift

    public init(amount: Double, currency: CCurrency, exponent: Int) throws
  • Amount in minor units as integer value.

    Declaration

    Swift

    public var amount: Int64
  • Amount in minor units as integer value.

    Declaration

    Swift

    public var intAmount: Int { get }
  • Amount in major units as floating point value.

    Declaration

    Swift

    public var decimalValue: Double { get set }
  • Currency to use for transaction.

    Declaration

    Swift

    public var currency: CCurrency { get set }
  • Exponent.

    Declaration

    Swift

    public var exponent: Int
  • Textual representation.

    Declaration

    Swift

    public var description: String { get }
  • Rounding behvaiour: Round to the closest possible return value; when caught halfway between two positive numbers, round up; when caught between two negative numbers, round down.

    Declaration

    Swift

    public static let RoundingBehaviour: NSDecimalNumberHandler