Price
public struct Price
extension Price: CustomStringConvertible
extension Price: Equatable
Price of a commodity in another commodity on a given date
-
Date of the Price
Declaration
Swift
public let date: Date -
CommoditySymbolof the PriceDeclaration
Swift
public let commoditySymbol: CommoditySymbol -
MetaData of the Price
Declaration
Swift
public let metaData: [String : String] -
Create a price
Throws
PriceError.sameCommodity if the commodity and the commodity of the amount are the sameDeclaration
Swift
public init(date: Date, commoditySymbol: CommoditySymbol, amount: Amount, metaData: [String : String] = [:]) throwsParameters
datedate of the price
commoditycommodity
amountamount
-
Returns the price string for the ledger.
Declaration
Swift
public var description: String { get } -
Retuns if the two prices are equal
Declaration
Swift
public static func == (lhs: Price, rhs: Price) -> BoolParameters
lhsprice 1
rhsprice 2
Return Value
true if the prices are equal, false otherwise
View on GitHub
Install in Dash
Price Structure Reference