;lib: rename setMinimalPrecision -> setNaturalPrecision

This commit is contained in:
Simon Michael 2019-06-14 18:32:00 -07:00
parent 69defd497f
commit 5cb334514c
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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]