hledger/tests/journal/commodity-styles.test

56 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-02-20 08:43:04 +03:00
# 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.
2016-02-20 08:43:04 +03:00
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 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. A multi-line commodity directive also works.
hledger -f- bal -V -N
<<<
commodity B
format 1.00 B
2016-02-20 08:43:04 +03:00
P 2015/1/1 A 1.0001 B
2016-02-20 08:43:04 +03:00
2015/1/1
(a) 1.00 A
(b) 1.00 B
>>>
1.00 B a
1.00 B b
>>>=0
2016-05-14 08:10:23 +03:00
# 3. This should choose the 1,000.00 format (the first amount sets
2016-02-20 08:43:04 +03:00
# 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