From 5cb334514c72b9b89629413f380eebbb04fb5274 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 14 Jun 2019 18:32:00 -0700 Subject: [PATCH] ;lib: rename setMinimalPrecision -> setNaturalPrecision --- hledger-lib/Hledger/Data/Amount.hs | 6 +++--- hledger/Hledger/Cli/Commands/Close.hs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hledger-lib/Hledger/Data/Amount.hs b/hledger-lib/Hledger/Data/Amount.hs index e976da03a..33543a1fc 100644 --- a/hledger-lib/Hledger/Data/Amount.hs +++ b/hledger-lib/Hledger/Data/Amount.hs @@ -76,7 +76,7 @@ module Hledger.Data.Amount ( setAmountPrecision, withPrecision, setFullPrecision, - setMinimalPrecision, + setNaturalPrecision, setAmountInternalPrecision, withInternalPrecision, setAmountDecimalPoint, @@ -293,8 +293,8 @@ setFullPrecision a = setAmountPrecision p a -- | Set an amount's display precision to just enough so that it will -- be shown exactly, with all significant decimal places. -setMinimalPrecision :: Amount -> Amount -setMinimalPrecision a = setAmountPrecision normalprecision a +setNaturalPrecision :: Amount -> Amount +setNaturalPrecision a = setAmountPrecision normalprecision a where normalprecision = fromIntegral $ decimalPlaces $ normalizeDecimal $ aquantity a diff --git a/hledger/Hledger/Cli/Commands/Close.hs b/hledger/Hledger/Cli/Commands/Close.hs index b4cfef9fd..c51ff6571 100755 --- a/hledger/Hledger/Cli/Commands/Close.hs +++ b/hledger/Hledger/Cli/Commands/Close.hs @@ -41,7 +41,7 @@ close CliOpts{rawopts_=rawopts, reportopts_=ropts} j = do -- since balance assertion amounts are required to be exact, the -- amounts in opening/closing transactions should be too (#941) -- setprec = setFullPrecision - setprec = setMinimalPrecision + setprec = setNaturalPrecision -- balance assertion amounts will be unpriced, cf #824 closingps = [posting{paccount=a ,pamount=mixed [setprec $ negate b]