From 9f9305578299dbda7b5d5f606a9a43859f3b09c6 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 7 Jun 2025 17:40:55 -1000 Subject: [PATCH] ;dev: tests showing P and inferred amounts affecting display precision --- hledger/test/journal/precision.test | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/hledger/test/journal/precision.test b/hledger/test/journal/precision.test index 183fc7231..518f7b628 100644 --- a/hledger/test/journal/precision.test +++ b/hledger/test/journal/precision.test @@ -201,3 +201,30 @@ P 2025-01-01 USD 7.147224669603524229074889868 CNY a 811.21 CNY $ hledger -f - check + +# ** 14. Note that although cost amounts don't influence display precision, P amounts do, currently. +$ hledger -f - bal -N +811.210000000000000000000000000 CNY + -113.50 USD a + +# ** 15. Without the P directive, the posting amount's precision is used (2 digits). +< +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 + a -113.50 USD @ 7.147224669603524229074889868 CNY + a 811.21 CNY + z + +$ hledger -f - bal -N +811.210000000000000000000000000 CNY + -113.50 USD a +0.000000000000000000000000018 CNY z