Amount

public struct Amount : Codable, Equatable

Describes the amount of a payment.

  • The value of the amount in minor units.

    Declaration

    Swift

    public let value: Int
  • The code of the currency in which the amount’s value is specified.

    Declaration

    Swift

    public let currencyCode: String
  • The identifier of the locale.

    Declaration

    Swift

    public var localeIdentifier: String?
  • Initializes an Amount.

    Declaration

    Swift

    public init(value: Int, currencyCode: String, localeIdentifier: String? = nil)

    Parameters

    value

    The value in minor units.

    currencyCode

    The code of the currency.

    localeIdentifier

    The identifier of the locale.

  • Initializes an Amount from a Decimal value expressed in major units.

    Declaration

    Swift

    public init(value: Decimal, currencyCode: String, localeIdentifier: String? = nil)

    Parameters

    value

    The value in major units.

    currencyCode

    The code of the currency.

    localeIdentifier

    The identifier of the locale.