2011-01-19 22:00:42 +03:00
|
|
|
# amount layout tests, using default vertical layout
|
|
|
|
# 1. print
|
2017-01-13 18:25:44 +03:00
|
|
|
hledger -f - print --explicit
|
2010-07-12 02:51:36 +04:00
|
|
|
<<<
|
|
|
|
2010/1/1
|
2012-12-06 04:28:23 +04:00
|
|
|
a EUR 1 ; a euro
|
|
|
|
b USD 1 ; a dollar
|
|
|
|
c ; a euro and a dollar
|
2010-07-12 02:51:36 +04:00
|
|
|
>>>
|
2011-01-19 21:55:16 +03:00
|
|
|
2010/01/01
|
2017-06-05 07:26:18 +03:00
|
|
|
a EUR 1 ; a euro
|
|
|
|
b USD 1 ; a dollar
|
|
|
|
c EUR -1 ; a euro and a dollar
|
|
|
|
c USD -1 ; a euro and a dollar
|
2010-07-12 02:51:36 +04:00
|
|
|
|
2011-03-12 23:55:49 +03:00
|
|
|
>>>=0
|
|
|
|
|
2011-01-19 22:00:42 +03:00
|
|
|
# 2. register
|
2015-07-12 21:54:08 +03:00
|
|
|
hledger -f - register
|
2010-07-12 02:51:36 +04:00
|
|
|
<<<
|
|
|
|
2010/1/1
|
2012-12-06 04:28:23 +04:00
|
|
|
a EUR 1 ; a euro
|
|
|
|
b USD 1 ; a dollar
|
|
|
|
c ; a euro and a dollar
|
2010-07-12 02:51:36 +04:00
|
|
|
>>>
|
2013-04-13 01:56:41 +04:00
|
|
|
2010/01/01 a EUR 1 EUR 1
|
2014-07-07 19:37:27 +04:00
|
|
|
b USD 1 EUR 1
|
|
|
|
USD 1
|
|
|
|
c EUR -1
|
|
|
|
USD -1 0
|
2011-03-12 23:55:49 +03:00
|
|
|
>>>=0
|
|
|
|
|
2011-01-19 22:00:42 +03:00
|
|
|
# 3. balance
|
2015-07-12 21:54:08 +03:00
|
|
|
hledger -f - balance
|
2010-07-12 02:51:36 +04:00
|
|
|
<<<
|
|
|
|
2010/1/1
|
2012-12-06 04:28:23 +04:00
|
|
|
a EUR 1 ; a euro
|
|
|
|
b USD 1 ; a dollar
|
|
|
|
c ; a euro and a dollar
|
2010-07-12 02:51:36 +04:00
|
|
|
>>>
|
|
|
|
EUR 1 a
|
|
|
|
USD 1 b
|
2015-08-20 06:28:24 +03:00
|
|
|
EUR -1
|
2010-07-12 02:51:36 +04:00
|
|
|
USD -1 c
|
|
|
|
--------------------
|
2011-04-22 17:50:05 +04:00
|
|
|
0
|
2011-03-12 23:55:49 +03:00
|
|
|
>>>=0
|
|
|
|
|
2015-09-03 02:38:45 +03:00
|
|
|
# 4. a single-commodity zero amount's commodity/decimal places/price is preserved, when possible
|
2017-01-13 18:25:44 +03:00
|
|
|
hledger -f- print --explicit --empty
|
2014-05-07 08:00:49 +04:00
|
|
|
<<<
|
|
|
|
2010/3/1 x
|
|
|
|
a $0.00 @ 3EUR
|
|
|
|
b
|
|
|
|
>>>
|
|
|
|
2010/03/01 x
|
2017-06-05 07:26:18 +03:00
|
|
|
a 0 @ 3EUR
|
|
|
|
b 0
|
2014-05-07 08:00:49 +04:00
|
|
|
|
|
|
|
>>>=0
|
|
|
|
|
2015-09-03 02:38:45 +03:00
|
|
|
# 5.
|
|
|
|
# When preserving a zero amount's commodity, we should also preserve
|
|
|
|
# the amount style, such as where to place the symbol.
|
|
|
|
# https://github.com/simonmichael/hledger/issues/230
|
|
|
|
hledger -f- balance
|
|
|
|
<<<
|
|
|
|
D 1000,00€
|
|
|
|
|
|
|
|
1/1
|
|
|
|
a:b 0
|
|
|
|
|
|
|
|
1/2
|
|
|
|
a:1 4000,58
|
|
|
|
a:D -1000,58
|
|
|
|
e -3000
|
|
|
|
>>>
|
|
|
|
3000,00€ a
|
|
|
|
4000,58€ 1
|
|
|
|
-1000,58€ D
|
|
|
|
-3000,00€ e
|
|
|
|
--------------------
|
|
|
|
0
|
|
|
|
>>>= 0
|
|
|
|
|
|
|
|
|
2014-05-07 08:00:49 +04:00
|
|
|
# 5. mixed amounts with prices
|
2011-01-19 22:00:42 +03:00
|
|
|
# XXX
|
2015-07-12 21:54:08 +03:00
|
|
|
# hledger -f - print
|
2011-01-19 22:00:42 +03:00
|
|
|
# <<<
|
|
|
|
# 2010/1/1
|
|
|
|
# a EUR 1 @ USD 1.1 ; a euro
|
2012-12-06 04:28:23 +04:00
|
|
|
# b USD 1 ; a dollar
|
|
|
|
# c ; a euro and a dollar
|
2011-01-19 22:00:42 +03:00
|
|
|
# >>>
|
|
|
|
# 2010/01/01
|
2012-12-06 04:28:23 +04:00
|
|
|
# a EUR 1 @ USD 1.1 ; a euro
|
|
|
|
# b USD 1 ; a dollar
|
2011-01-19 22:00:42 +03:00
|
|
|
# EUR -1 @ USD 1.1
|
2012-12-06 04:28:23 +04:00
|
|
|
# c USD -1 ; a euro and a dollar
|
2011-01-19 22:00:42 +03:00
|
|
|
#
|
|
|
|
##
|
|
|
|
# 2010/01/01
|
2012-12-06 04:28:23 +04:00
|
|
|
# a EUR 1 @ USD 1.1 ; a euro
|
|
|
|
# b USD 1.0 ; a dollar
|
|
|
|
# c USD -2.1 ; a euro and a dollar
|
2011-01-19 22:00:42 +03:00
|
|
|
#
|
2011-03-12 23:55:49 +03:00
|
|
|
#>>>=0
|
|
|
|
#
|
2011-01-19 22:00:42 +03:00
|
|
|
# #
|
2015-07-12 21:54:08 +03:00
|
|
|
# hledger -f - register
|
2011-01-19 22:00:42 +03:00
|
|
|
# <<<
|
|
|
|
# 2010/1/1
|
|
|
|
# a EUR 1 @ USD 1.1 ; a euro
|
2012-12-06 04:28:23 +04:00
|
|
|
# b USD 1 ; a dollar
|
|
|
|
# c ; a euro and a dollar
|
2011-01-19 22:00:42 +03:00
|
|
|
# >>>
|
|
|
|
# 2010/01/01 a EUR 1 EUR 1
|
|
|
|
# EUR 1
|
|
|
|
# b USD 1.0 USD 1.0
|
|
|
|
# EUR 1
|
|
|
|
# c USD -2.1 USD -1.1
|
2011-03-12 23:55:49 +03:00
|
|
|
#>>>=0
|
|
|
|
#
|
2011-01-19 22:00:42 +03:00
|
|
|
# #
|
2015-07-12 21:54:08 +03:00
|
|
|
# hledger -f - balance
|
2011-01-19 22:00:42 +03:00
|
|
|
# <<<
|
|
|
|
# 2010/1/1
|
|
|
|
# a EUR 1 @ USD 1.1 ; a euro
|
2012-12-06 04:28:23 +04:00
|
|
|
# b USD 1 ; a dollar
|
|
|
|
# c ; a euro and a dollar
|
2011-01-19 22:00:42 +03:00
|
|
|
# >>>
|
|
|
|
# EUR 1 a
|
|
|
|
# USD 1.0 b
|
|
|
|
# USD -2.1 c
|
|
|
|
# --------------------
|
|
|
|
# EUR 1
|
|
|
|
# USD -1.1
|