;dev: test showing formerly accepted inexact entry now rejected [#2402]
This commit is contained in:
parent
9f93055782
commit
21d403d45d
@ -189,7 +189,7 @@ $ hledger -f - bal -O csv
|
|||||||
"c","1000 JPY"
|
"c","1000 JPY"
|
||||||
"Total:","1002 JPY"
|
"Total:","1002 JPY"
|
||||||
|
|
||||||
# ** 13. An entry like this, generated by bean-report, did not balance in hledger <=1.43,
|
# ** 13. Before hledger 1.44, an entry like this (generated by bean-report) did not balance,
|
||||||
# because the P amount influenced the commodity's display (and balancing) precision.
|
# because the P amount influenced the commodity's display (and balancing) precision.
|
||||||
# From 1.44 transaction balancing uses the transaction's local precisions,
|
# From 1.44 transaction balancing uses the transaction's local precisions,
|
||||||
# so CNY's precision is 2 and this does balance.
|
# so CNY's precision is 2 and this does balance.
|
||||||
@ -202,22 +202,12 @@ P 2025-01-01 USD 7.147224669603524229074889868 CNY
|
|||||||
|
|
||||||
$ hledger -f - check
|
$ hledger -f - check
|
||||||
|
|
||||||
# ** 14. Note that although cost amounts don't influence display precision, P amounts do, currently.
|
# ** 14. Note that P amounts do influence display precision, currently.
|
||||||
$ hledger -f - bal -N
|
$ hledger -f - bal -N
|
||||||
811.210000000000000000000000000 CNY
|
811.210000000000000000000000000 CNY
|
||||||
-113.50 USD a
|
-113.50 USD a
|
||||||
|
|
||||||
# ** 15. Without the P directive, the posting amount's precision is used (2 digits).
|
# ** 15. And inferred posting amounts can also influence display precision.
|
||||||
<
|
|
||||||
2025-01-01
|
|
||||||
a -113.50 USD @ 7.147224669603524229074889868 CNY
|
|
||||||
a 811.21 CNY
|
|
||||||
|
|
||||||
$ hledger -f - bal -N
|
|
||||||
811.21 CNY
|
|
||||||
-113.50 USD a
|
|
||||||
|
|
||||||
# ** 16. Inferred posting amounts can also influence display precision.
|
|
||||||
<
|
<
|
||||||
2025-01-01
|
2025-01-01
|
||||||
a -113.50 USD @ 7.147224669603524229074889868 CNY
|
a -113.50 USD @ 7.147224669603524229074889868 CNY
|
||||||
@ -228,3 +218,18 @@ $ hledger -f - bal -N
|
|||||||
811.210000000000000000000000000 CNY
|
811.210000000000000000000000000 CNY
|
||||||
-113.50 USD a
|
-113.50 USD a
|
||||||
0.000000000000000000000000018 CNY z
|
0.000000000000000000000000018 CNY z
|
||||||
|
|
||||||
|
# ** 16. Before hledger 1.44, an inexactly balanced entry like this could be accepted
|
||||||
|
# because of a commodity directive reducing the display/balance-checking precision.
|
||||||
|
# From 1.44, transaction balancing uses the transaction's local precisions only,
|
||||||
|
# making the balance checking more strict in this case.
|
||||||
|
<
|
||||||
|
commodity $1.00
|
||||||
|
|
||||||
|
2025-01-01
|
||||||
|
a 1 C @ $1.1206
|
||||||
|
a -$1.120
|
||||||
|
|
||||||
|
$ hledger -f - check
|
||||||
|
>2 /unbalanced/
|
||||||
|
>= 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user