2010-11-13 02:54:21 +03:00
|
|
|
# a default commodity defined with the D directive will be used for any
|
|
|
|
# commodity-less amounts in subsequent transactions.
|
2011-09-23 02:23:28 +04:00
|
|
|
|
|
|
|
# 1. no default commodity
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- print
|
2010-11-13 02:54:21 +03:00
|
|
|
<<<
|
2011-09-23 02:23:28 +04:00
|
|
|
2010/1/1
|
2010-11-13 02:54:21 +03:00
|
|
|
a 1000
|
|
|
|
b
|
2011-09-23 02:23:28 +04:00
|
|
|
>>>
|
|
|
|
2010/01/01
|
|
|
|
a 1000
|
|
|
|
b -1000
|
2010-11-13 02:54:21 +03:00
|
|
|
|
2011-09-23 02:23:28 +04:00
|
|
|
>>>=0
|
2010-11-13 02:54:21 +03:00
|
|
|
|
2011-09-23 02:23:28 +04:00
|
|
|
# 2. pound, two decimal places, no digit group separator
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- print
|
2011-09-23 02:23:28 +04:00
|
|
|
<<<
|
|
|
|
D £1000.00
|
|
|
|
2010/1/1
|
2010-11-13 02:54:21 +03:00
|
|
|
a 1000
|
|
|
|
b
|
2011-09-23 02:23:28 +04:00
|
|
|
>>>
|
|
|
|
2010/01/01
|
|
|
|
a £1000.00
|
|
|
|
b £-1000.00
|
2010-11-13 02:54:21 +03:00
|
|
|
|
2011-09-23 02:23:28 +04:00
|
|
|
>>>=0
|
2010-11-13 02:54:21 +03:00
|
|
|
|
2011-09-23 02:23:28 +04:00
|
|
|
# 3. dollar, comma decimal point, three decimal places, no digit group separator
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- print
|
2011-09-23 02:23:28 +04:00
|
|
|
<<<
|
|
|
|
D $1,000
|
|
|
|
2010/1/1
|
2010-11-13 02:54:21 +03:00
|
|
|
a 1000
|
|
|
|
b
|
2011-09-23 02:23:28 +04:00
|
|
|
>>>
|
|
|
|
2010/01/01
|
|
|
|
a $1000,000
|
|
|
|
b $-1000,000
|
2010-11-13 02:54:21 +03:00
|
|
|
|
2011-09-23 02:23:28 +04:00
|
|
|
>>>=0
|
|
|
|
|
|
|
|
# 4. dollar, three digit group separator, one decimal place
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- print
|
2011-09-23 02:23:28 +04:00
|
|
|
<<<
|
|
|
|
D $1,000.0
|
|
|
|
2010/1/1
|
|
|
|
(a) 1000000
|
2010-11-13 02:54:21 +03:00
|
|
|
>>>
|
2011-09-23 02:23:28 +04:00
|
|
|
2010/01/01
|
|
|
|
(a) $1,000,000.0
|
2010-11-13 02:54:21 +03:00
|
|
|
|
2011-09-23 02:23:28 +04:00
|
|
|
>>>=0
|
2010-11-13 02:54:21 +03:00
|
|
|
|
2011-09-23 02:23:28 +04:00
|
|
|
# 5. as above, sets the commodity of the commodityless amount, but an
|
|
|
|
# earlier explicit dollar amount sets the display settings for dollar
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- print
|
2011-09-23 02:23:28 +04:00
|
|
|
<<<
|
|
|
|
D $1,000.0
|
|
|
|
2010/1/1
|
|
|
|
(a) $1000000.00
|
|
|
|
(b) 1000000
|
|
|
|
>>>
|
|
|
|
2010/01/01
|
|
|
|
(a) $1000000.00
|
|
|
|
(b) $1000000.00
|
|
|
|
|
|
|
|
>>>=0
|
|
|
|
|
|
|
|
# 6. as above, but the commodityless amount is earliest, so it sets the
|
|
|
|
# display settings for dollar. The greatest precision is preserved though.
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- print
|
2011-09-23 02:23:28 +04:00
|
|
|
<<<
|
|
|
|
D $1,000.0
|
|
|
|
2010/1/1
|
|
|
|
(a) 1000000
|
|
|
|
(b) $1000000.00
|
|
|
|
>>>
|
|
|
|
2010/01/01
|
|
|
|
(a) $1,000,000.00
|
|
|
|
(b) $1,000,000.00
|
2010-11-13 02:54:21 +03:00
|
|
|
|
2011-08-15 02:15:39 +04:00
|
|
|
>>>=0
|
2011-09-23 02:23:28 +04:00
|
|
|
|