;lib: rename setMinimalPrecision -> setNaturalPrecision
This commit is contained in:
parent
69defd497f
commit
5cb334514c
@ -76,7 +76,7 @@ module Hledger.Data.Amount (
|
|||||||
setAmountPrecision,
|
setAmountPrecision,
|
||||||
withPrecision,
|
withPrecision,
|
||||||
setFullPrecision,
|
setFullPrecision,
|
||||||
setMinimalPrecision,
|
setNaturalPrecision,
|
||||||
setAmountInternalPrecision,
|
setAmountInternalPrecision,
|
||||||
withInternalPrecision,
|
withInternalPrecision,
|
||||||
setAmountDecimalPoint,
|
setAmountDecimalPoint,
|
||||||
@ -293,8 +293,8 @@ setFullPrecision a = setAmountPrecision p a
|
|||||||
|
|
||||||
-- | Set an amount's display precision to just enough so that it will
|
-- | Set an amount's display precision to just enough so that it will
|
||||||
-- be shown exactly, with all significant decimal places.
|
-- be shown exactly, with all significant decimal places.
|
||||||
setMinimalPrecision :: Amount -> Amount
|
setNaturalPrecision :: Amount -> Amount
|
||||||
setMinimalPrecision a = setAmountPrecision normalprecision a
|
setNaturalPrecision a = setAmountPrecision normalprecision a
|
||||||
where
|
where
|
||||||
normalprecision = fromIntegral $ decimalPlaces $ normalizeDecimal $ aquantity a
|
normalprecision = fromIntegral $ decimalPlaces $ normalizeDecimal $ aquantity a
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ close CliOpts{rawopts_=rawopts, reportopts_=ropts} j = do
|
|||||||
-- since balance assertion amounts are required to be exact, the
|
-- since balance assertion amounts are required to be exact, the
|
||||||
-- amounts in opening/closing transactions should be too (#941)
|
-- amounts in opening/closing transactions should be too (#941)
|
||||||
-- setprec = setFullPrecision
|
-- setprec = setFullPrecision
|
||||||
setprec = setMinimalPrecision
|
setprec = setNaturalPrecision
|
||||||
-- balance assertion amounts will be unpriced, cf #824
|
-- balance assertion amounts will be unpriced, cf #824
|
||||||
closingps = [posting{paccount=a
|
closingps = [posting{paccount=a
|
||||||
,pamount=mixed [setprec $ negate b]
|
,pamount=mixed [setprec $ negate b]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user