From 6bd862efbfb78e9e8bd8f937e88596923cbbc855 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 14 Nov 2023 13:22:35 -0800 Subject: [PATCH] imp: ui: round amounts to display precision as before (precisiongeddon) --- hledger-ui/Hledger/UI/UIScreens.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hledger-ui/Hledger/UI/UIScreens.hs b/hledger-ui/Hledger/UI/UIScreens.hs index 73c1d529b..081de69d7 100644 --- a/hledger-ui/Hledger/UI/UIScreens.hs +++ b/hledger-ui/Hledger/UI/UIScreens.hs @@ -159,7 +159,9 @@ asUpdateHelper rspec0 d copts roptsModify extraquery j ass = dbgui "asUpdateHelp displayitems = map displayitem items where -- run the report - (items, _) = balanceReport rspec j + (items, _) = styleAmounts styles $ balanceReport rspec j + where + styles = journalCommodityStylesWith HardRounding j -- pre-render a list item displayitem (fullacct, shortacct, indent, bal) = @@ -267,7 +269,9 @@ rsUpdate uopts d j rss@RSS{_rssAccount, _rssForceInclusive, _rssList=oldlist} = & reportSpecSetFutureAndForecast (forecast_ $ inputopts_ copts) -- gather transactions to display - items = accountTransactionsReport rspec' j thisacctq + items = styleAmounts styles $ accountTransactionsReport rspec' j thisacctq + where + styles = journalCommodityStylesWith HardRounding j items' = (if empty_ ropts then id else filter (not . mixedAmountLooksZero . fifth6)) $ -- without --empty, exclude no-change txns reverse -- most recent last