amount haddock updates
This commit is contained in:
parent
676845b269
commit
68f13e18af
@ -1,7 +1,7 @@
|
|||||||
{-# LANGUAGE StandaloneDeriving #-}
|
{-# LANGUAGE StandaloneDeriving #-}
|
||||||
{-|
|
{-|
|
||||||
A simple "Amount" is some quantity of money, shares, or anything else.
|
A simple 'Amount' is some quantity of money, shares, or anything else.
|
||||||
It has a (possibly null) "Commodity" and a numeric quantity:
|
It has a (possibly null) 'Commodity' and a numeric quantity:
|
||||||
|
|
||||||
@
|
@
|
||||||
$1
|
$1
|
||||||
@ -13,14 +13,16 @@ It has a (possibly null) "Commodity" and a numeric quantity:
|
|||||||
0
|
0
|
||||||
@
|
@
|
||||||
|
|
||||||
It may also have an assigned unit price, which is another (unpriced)
|
It may also have an assigned 'Price', representing this amount's per-unit
|
||||||
simple amount in a different commodity. If present, this is rendered like so:
|
or total cost in a different commodity. If present, this is rendered like
|
||||||
|
so:
|
||||||
|
|
||||||
@
|
@
|
||||||
EUR 3 \@ $1.35
|
EUR 2 \@ $1.50 (unit price)
|
||||||
|
EUR 2 \@\@ $3 (total price)
|
||||||
@
|
@
|
||||||
|
|
||||||
A "MixedAmount" is zero or more simple amounts, so can represent multiple
|
A 'MixedAmount' is zero or more simple amounts, so can represent multiple
|
||||||
commodities; this is the type most often used:
|
commodities; this is the type most often used:
|
||||||
|
|
||||||
@
|
@
|
||||||
@ -33,14 +35,12 @@ When a mixed amount has been \"normalised\", it has no more than one amount
|
|||||||
in each commodity and no zero amounts; or it has just a single zero amount
|
in each commodity and no zero amounts; or it has just a single zero amount
|
||||||
and no others.
|
and no others.
|
||||||
|
|
||||||
We can do two kinds of limited arithmetic with simple or mixed amounts:
|
Limited arithmetic with simple and mixed amounts is supported, best used
|
||||||
price-preserving (for amounts with the same prices) or price-ignoring
|
with similar amounts since it mostly ignores assigned prices and commodity
|
||||||
(ignores and discards any prices).
|
exchange rates.
|
||||||
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
-- XXX due for review/rewrite
|
|
||||||
|
|
||||||
module Hledger.Data.Amount (
|
module Hledger.Data.Amount (
|
||||||
-- * Amount
|
-- * Amount
|
||||||
nullamt,
|
nullamt,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user