From 0274b307427998c42e48374fa04bbae98e2ea528 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 4 Feb 2021 06:46:09 -0800 Subject: [PATCH] print: don't add decimal places in assertion/assignment amounts either (#1465) --- hledger-lib/Hledger/Data/Journal.hs | 4 ++-- hledger/test/csv.test | 4 ++-- hledger/test/journal/parse-errors.test | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hledger-lib/Hledger/Data/Journal.hs b/hledger-lib/Hledger/Data/Journal.hs index 4929407bd..48b317540 100644 --- a/hledger-lib/Hledger/Data/Journal.hs +++ b/hledger-lib/Hledger/Data/Journal.hs @@ -981,8 +981,8 @@ journalApplyCommodityStyles j@Journal{jtxns=ts, jpricedirectives=pds} = fixtransaction t@Transaction{tpostings=ps} = t{tpostings=map fixposting ps} fixposting p = p{pamount=styleMixedAmount styles $ pamount p ,pbalanceassertion=fixbalanceassertion <$> pbalanceassertion p} - -- balance assertion amounts are always displayed, eg by print, at full precision, per docs - fixbalanceassertion ba = ba{baamount=setFullPrecision $ styleAmount styles $ baamount ba} + -- balance assertion amounts are always displayed (by print) at full precision, per docs + fixbalanceassertion ba = ba{baamount=styleAmountExceptPrecision styles $ baamount ba} fixpricedirective pd@PriceDirective{pdamount=a} = pd{pdamount=styleAmountExceptPrecision styles a} -- | Get the canonical amount styles for this journal, whether (in order of precedence): diff --git a/hledger/test/csv.test b/hledger/test/csv.test index 8311e50c3..831071ad2 100644 --- a/hledger/test/csv.test +++ b/hledger/test/csv.test @@ -219,8 +219,8 @@ account4 the:remainder $ ./csvtest.sh 2009-09-10 Flubber Co - assets:myacct $50.000 = $321.000 - income:unknown $-50.000 = $123.000 + assets:myacct $50.000 = $321 + income:unknown $-50.000 = $123 expenses:tax $0.234 ; VAT the:remainder diff --git a/hledger/test/journal/parse-errors.test b/hledger/test/journal/parse-errors.test index 7cb731d8d..51eb84294 100644 --- a/hledger/test/journal/parse-errors.test +++ b/hledger/test/journal/parse-errors.test @@ -150,8 +150,8 @@ $ hledger -f- print equity:opening/closing balances 2019-12-31 closing balances - assets:a1 $-3 = $0 - assets:a2 £-10 = £0 + assets:a1 $-3 = $0.00 + assets:a2 £-10 = £0.00 equity:opening/closing balances >=0