MultiCurrencyAmount
public struct MultiCurrencyAmount
extension MultiCurrencyAmount: MultiCurrencyAmountRepresentable
extension MultiCurrencyAmount: Equatable
Represents an amout which consists of amouts in multiple currencies
Tolerance for validation: Half of the last digit of precision provided separately for each currency
-
amounts per currency
Declaration
Swift
public let amounts: [CommoditySymbol : Decimal]
-
Returns the amount of one commodity
If there is not amount for the given symbol in this MultiCurrencyAmount it returns an amount with zero.
Declaration
Swift
public func amountFor(symbol: CommoditySymbol) -> Amount
Parameters
symbol
symbol of the commodity to get
Return Value
Amount
-
Checks is the amount is zero within the allowed tolerance
Declaration
Swift
public func isZeroWithTolerance() -> Bool
Return Value
Bool
-
Creates an empty MultiCurrencyAmount
Declaration
Swift
public init()
-
returns self to conform to the
MultiCurrencyAmountRepresentable
protocolDeclaration
Swift
public var multiCurrencyAmount: MultiCurrencyAmount { get }
-
Declaration
Swift
public static func == (lhs: MultiCurrencyAmount, rhs: MultiCurrencyAmount) -> Bool