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
-
CommoditySymbol
of 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] = [:]) throws
Parameters
date
date of the price
commodity
commodity
amount
amount
-
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) -> Bool
Parameters
lhs
price 1
rhs
price 2
Return Value
true if the prices are equal, false otherwise