The commodity directive's format subdirective can now be used to override the inferred style for a commodity, eg to increase or decrease the precision. This doesn't fix the root cause of #295 but is at least a good workaround.
41 lines
893 B
Plaintext
41 lines
893 B
Plaintext
# 1. The four decimal places of the market price should not alter the
|
|
# canonical style of two decimal places in a's converted-to-B balance
|
|
# (#295), but it turns out they do with -V. This can be fixed with a
|
|
# commodity directive.
|
|
hledger -f- bal -V -N
|
|
<<<
|
|
; use a commodity directive to ensure B is displayed with two decimal
|
|
; places, or the price directive plus -V would make it four
|
|
commodity B
|
|
format 1.00 B
|
|
|
|
P 2015/1/1 A 1.0001 B
|
|
|
|
2015/1/1
|
|
(a) 1.00 A
|
|
(b) 1.00 B
|
|
>>>
|
|
1.00 B a
|
|
1.00 B b
|
|
>>>=0
|
|
|
|
# 2. This should choose the 1,000.00 format (the first amount sets
|
|
# decimal point to period, the second sets digit group size to 3 and
|
|
# digit group separator to comma).
|
|
# hledger -f- print
|
|
# <<<
|
|
# 2015/1/1
|
|
# (a) 1000.00 A
|
|
|
|
# 2015/1/1
|
|
# (a) 1,000 A
|
|
# >>>
|
|
# 2015/01/01
|
|
# (a) 1,000.00 A
|
|
|
|
# 2015/01/01
|
|
# (a) 1,000.00 A
|
|
|
|
# >>>=0
|
|
|