56 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			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 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
 | 
						|
 | 
						|
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
 | 
						|
 | 
						|
# 3. 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
 | 
						|
 |