mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-12 19:08:34 +03:00
;lib: rename setMinimalPrecision -> setNaturalPrecision
This commit is contained in:
parent
69defd497f
commit
5cb334514c
@ -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
|
||||
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user