lib: export mapMixedAmount

This commit is contained in:
Simon Michael 2020-01-20 17:09:07 -08:00
parent 1e9f30bafc
commit 64546cd54a

View File

@ -96,6 +96,7 @@ module Hledger.Data.Amount (
amounts, amounts,
filterMixedAmount, filterMixedAmount,
filterMixedAmountByCommodity, filterMixedAmountByCommodity,
mapMixedAmount,
normaliseMixedAmountSquashPricesForDisplay, normaliseMixedAmountSquashPricesForDisplay,
normaliseMixedAmount, normaliseMixedAmount,
-- ** arithmetic -- ** arithmetic
@ -295,9 +296,9 @@ setAmountPrecision p a@Amount{astyle=s} = a{astyle=s{asprecision=p}}
setFullPrecision :: Amount -> Amount setFullPrecision :: Amount -> Amount
setFullPrecision a = setAmountPrecision p a setFullPrecision a = setAmountPrecision p a
where where
p = max displayprecision normalprecision p = max displayprecision naturalprecision
displayprecision = asprecision $ astyle a displayprecision = asprecision $ astyle a
normalprecision = fromIntegral $ decimalPlaces $ normalizeDecimal $ aquantity a naturalprecision = fromIntegral $ decimalPlaces $ normalizeDecimal $ aquantity a
-- | Set an amount's display precision to just enough decimal places -- | Set an amount's display precision to just enough decimal places
-- to show it exactly (possibly less than the number specified by -- to show it exactly (possibly less than the number specified by