hledger/tests/journal/market-prices.test
Simon Michael 71921135f6 include P amounts in canonicalisation (fixes #131)
Since market price amounts didn't contribute to the canonical commodity
styles, they were being reset to the null style. And this propagated to
the reported amounts when -V was in effect, causing much confusion.
Now, market prices contribute to canonicalisation and the expected
styles are preserved even with -V.

cf https://github.com/simonmichael/hledger/issues/131#issuecomment-133545140
2015-10-11 16:07:31 -07:00

26 lines
567 B
Plaintext

# market prices defined with the P directive are used by -V/--value.
# 1. market prices (a) are affected by D directives and (b) contribute
# to amount style canonicalisation.
# (https://github.com/simonmichael/hledger/issues/131#issuecomment-133545140)
hledger -f- balance -V
<<<
D 1000.00 H
P 2015/08/14 EEEE 41.66
P 2015/08/14 FFFF 74.62
P 2015/08/14 GGGG 32.39
2015/08/15
a 2.4120 EEEE @@ 100
a 0.3350 FFFF @@ 25
a 0.7718 GGGG @@ 25
b
>>>
150.48 H a
-150.00 H b
--------------------
0.48 H
>>>=0