From 7182fa4746a9134a730589c7f564a6f87b57ee54 Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Fri, 21 Aug 2020 11:51:50 +1000 Subject: [PATCH] lib: Improve documentation for amountRoundedQuantity, fix a typo. --- hledger-lib/Hledger/Data/Amount.hs | 2 +- hledger-lib/Hledger/Read/Common.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hledger-lib/Hledger/Data/Amount.hs b/hledger-lib/Hledger/Data/Amount.hs index 043ea4475..258f28352 100644 --- a/hledger-lib/Hledger/Data/Amount.hs +++ b/hledger-lib/Hledger/Data/Amount.hs @@ -261,7 +261,7 @@ multiplyAmountAndPrice n a@Amount{aquantity=q,aprice=p} = a{aquantity=q*n, apric isNegativeAmount :: Amount -> Bool isNegativeAmount Amount{aquantity=q} = q < 0 --- | Round an Amount to its specified display precision. If that is +-- | Round an Amount's Quantity to its specified display precision. If that is -- NaturalPrecision, this does nothing. amountRoundedQuantity :: Amount -> Quantity amountRoundedQuantity Amount{aquantity=q, astyle=AmountStyle{asprecision=p}} = case p of diff --git a/hledger-lib/Hledger/Read/Common.hs b/hledger-lib/Hledger/Read/Common.hs index 05ece469e..286fabb00 100644 --- a/hledger-lib/Hledger/Read/Common.hs +++ b/hledger-lib/Hledger/Read/Common.hs @@ -855,7 +855,7 @@ fromRawNumber raw mExp = do toQuantity e preDecimalGrp postDecimalGrp | precision < 0 = Right (Decimal 0 (digitGrpNum * 10^(-precision)), 0) | precision < 256 = Right (Decimal precision8 digitGrpNum, precision8) - | otherwise = Left "invalid number: numbers with more than 255 decimal digits are now allowed at this time" + | otherwise = Left "invalid number: numbers with more than 255 decimal digits are not allowed at this time" where digitGrpNum = digitGroupNumber $ preDecimalGrp <> postDecimalGrp precision = toInteger (digitGroupLength postDecimalGrp) - e