2018-04-21 07:39:06 +03:00
|
|
|
# 1. Simple case
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f - --no-total
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a 1,000.00 EUR
|
|
|
|
b -1,000.00 EUR
|
|
|
|
>>>
|
|
|
|
1,000.00 EUR a
|
|
|
|
-1,000.00 EUR b
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 2. No digits before decimal sep
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f - --no-total
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a .01 EUR
|
|
|
|
b
|
|
|
|
>>>
|
|
|
|
0.01 EUR a
|
|
|
|
-0.01 EUR b
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 3. No digits after decimal sep
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f - --no-total
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a 1. EUR
|
|
|
|
b
|
|
|
|
>>>
|
|
|
|
1 EUR a
|
|
|
|
-1 EUR b
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 4. No digits at all
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a . EUR
|
|
|
|
b
|
|
|
|
>>>
|
|
|
|
>>>=1
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 5. Space between digits groups
|
2017-11-02 10:36:49 +03:00
|
|
|
hledger bal -f - --no-total
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a 1 000.00 EUR
|
|
|
|
b -1 000.00 EUR
|
|
|
|
>>>
|
|
|
|
1 000.00 EUR a
|
|
|
|
-1 000.00 EUR b
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 6. Space between digits groups in commodity directive
|
2017-11-02 10:36:49 +03:00
|
|
|
hledger bal -f - --no-total
|
|
|
|
<<<
|
|
|
|
commodity 1 000.00 EUR
|
|
|
|
|
|
|
|
2017/1/1
|
|
|
|
a 1,000.00 EUR
|
|
|
|
b -1,000.00 EUR
|
|
|
|
>>>
|
|
|
|
1 000.00 EUR a
|
|
|
|
-1 000.00 EUR b
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 7. Default commodity
|
2017-10-28 18:14:54 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
|
|
|
D 1,000.00 EUR
|
|
|
|
|
|
|
|
2017/1/1
|
|
|
|
a 1,000
|
2017-11-05 01:59:15 +03:00
|
|
|
b -1,000 EUR
|
2017-10-28 18:14:54 +03:00
|
|
|
>>>
|
|
|
|
1,000.00 EUR a
|
|
|
|
-1,000.00 EUR b
|
|
|
|
--------------------
|
|
|
|
0
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 8. Omitted decimals
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a 1,000 EUR
|
|
|
|
b -1,000.00 EUR
|
|
|
|
>>>
|
|
|
|
>>>=1
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 9. Omitted decimals with commodity hint
|
2017-10-28 18:14:54 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
|
|
|
commodity 1,000.00 EUR
|
|
|
|
|
|
|
|
2017/1/1
|
|
|
|
a 1,000 EUR
|
|
|
|
b -1,000.00 EUR
|
|
|
|
>>>
|
|
|
|
1,000.00 EUR a
|
|
|
|
-1,000.00 EUR b
|
|
|
|
--------------------
|
|
|
|
0
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 10. Omitted decimals with commodity hint and symbol on left
|
2017-10-28 18:14:54 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
|
|
|
commodity €1,000.00
|
|
|
|
|
|
|
|
2017/1/1
|
|
|
|
a €1,000
|
|
|
|
b €-1,000.00
|
|
|
|
>>>
|
|
|
|
€1,000.00 a
|
|
|
|
€-1,000.00 b
|
|
|
|
--------------------
|
|
|
|
0
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-08-17 09:37:26 +03:00
|
|
|
# 11. Commodity directive requires a decimal separator
|
2017-11-05 02:40:54 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
2018-04-21 07:56:06 +03:00
|
|
|
commodity 1000 EUR
|
2020-03-18 03:44:32 +03:00
|
|
|
>>>2 /Please include a decimal point or decimal comma/
|
2018-04-21 07:56:06 +03:00
|
|
|
>>>=1
|
2017-11-05 02:40:54 +03:00
|
|
|
|
2018-04-21 07:56:06 +03:00
|
|
|
# 12. Commodity directive with zero precision
|
2017-11-05 02:40:54 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
2018-04-21 07:56:06 +03:00
|
|
|
commodity 100. EUR
|
2017-11-05 02:40:54 +03:00
|
|
|
|
|
|
|
2017/1/1
|
|
|
|
a 1,000 EUR
|
|
|
|
b -1,000.00 EUR
|
|
|
|
>>>
|
|
|
|
1000 EUR a
|
|
|
|
-1000 EUR b
|
|
|
|
--------------------
|
|
|
|
0
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 13. Big prices
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f - --no-total
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a -1 BTC @ 24,840 UAH
|
|
|
|
b 24,840.00 UAH
|
|
|
|
>>>
|
|
|
|
>>>=1
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 14. Big prices with commodity hint
|
2017-10-28 18:14:54 +03:00
|
|
|
hledger bal -f - --no-total
|
|
|
|
<<<
|
|
|
|
commodity ₴1,000.00
|
|
|
|
|
|
|
|
2017/1/1
|
|
|
|
a -1 BTC @ ₴24,840
|
|
|
|
b ₴24,840.00
|
|
|
|
>>>
|
|
|
|
-1 BTC a
|
|
|
|
₴24,840.00 b
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 15. adjacent punctuation chars
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a 1,,0,,0.0 EUR
|
|
|
|
b -1..0..0,0 EUR
|
|
|
|
>>>
|
|
|
|
>>>=1
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 16. adjacent punctuation chars of different types
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a 1,0,.0 EUR
|
|
|
|
b -1.0.,0 EUR
|
|
|
|
>>>
|
|
|
|
>>>=1
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 17. separator chars vary
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a 1.0,0.0,0 EUR
|
|
|
|
b -1,0.0,0.0 EUR
|
|
|
|
>>>
|
|
|
|
>>>=1
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 18. number begins with a decimal char
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a .1 EUR
|
|
|
|
b -.1 EUR
|
|
|
|
>>>
|
|
|
|
0.1 EUR a
|
|
|
|
-0.1 EUR b
|
|
|
|
--------------------
|
|
|
|
0
|
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-04-21 07:39:06 +03:00
|
|
|
# 19. number begins with a separator char
|
2017-01-18 15:06:46 +03:00
|
|
|
hledger bal -f -
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
a ,100.0 EUR
|
|
|
|
b -,100.0 EUR
|
|
|
|
>>>
|
|
|
|
>>>=1
|