lib: amountValue, commodityValue doc cleanups
This commit is contained in:
parent
9adae02973
commit
6626778012
@ -444,9 +444,10 @@ canonicaliseAmount styles a@Amount{acommodity=c, astyle=s} = a{astyle=s'}
|
|||||||
where
|
where
|
||||||
s' = findWithDefault s c styles
|
s' = findWithDefault s c styles
|
||||||
|
|
||||||
-- | Find the market value of this amount on the given date in its
|
-- | Find the market value of this amount on the given valuation date
|
||||||
-- default valuation commodity, using the given market prices which
|
-- in its default valuation commodity (that of the latest applicable
|
||||||
-- are expected to be in parse order.
|
-- market price before the valuation date).
|
||||||
|
-- The given market prices are expected to be in parse order.
|
||||||
-- If no default valuation commodity can be found, the amount is left
|
-- If no default valuation commodity can be found, the amount is left
|
||||||
-- unchanged.
|
-- unchanged.
|
||||||
amountValue :: [MarketPrice] -> Day -> Amount -> Amount
|
amountValue :: [MarketPrice] -> Day -> Amount -> Amount
|
||||||
@ -457,14 +458,10 @@ amountValue ps d a@Amount{acommodity=c} =
|
|||||||
|
|
||||||
-- (This is here not in Commodity.hs to use the Amount Show instance above for debugging.)
|
-- (This is here not in Commodity.hs to use the Amount Show instance above for debugging.)
|
||||||
--
|
--
|
||||||
-- | Find the market value, if known, of one unit of the given
|
-- | Find the market value of one unit of the given commodity
|
||||||
-- commodity (A), on the given valuation date, in the commodity (B)
|
-- on the given valuation date in its default valuation commodity
|
||||||
-- mentioned in the latest applicable market price.
|
-- (that of the latest applicable market price before the valuation date).
|
||||||
-- The applicable price is obtained from the given market prices,
|
-- The given market prices are expected to be in parse order.
|
||||||
-- which are expected to be in parse order.
|
|
||||||
-- It is the price with the latest date on or before the valuation
|
|
||||||
-- date, or if there are multiple prices on that date, the last one
|
|
||||||
-- parsed.
|
|
||||||
commodityValue :: [MarketPrice] -> Day -> CommoditySymbol -> Maybe Amount
|
commodityValue :: [MarketPrice] -> Day -> CommoditySymbol -> Maybe Amount
|
||||||
commodityValue ps valuationdate c =
|
commodityValue ps valuationdate c =
|
||||||
case ps' of
|
case ps' of
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user