make isZeroAmount more robust, fix timelog balance total

This commit is contained in:
Simon Michael 2008-10-15 07:06:02 +00:00
parent f99963786c
commit 3dca1ca548

View File

@ -75,10 +75,7 @@ showAmountOrZero a
-- | is this amount zero, when displayed with its given precision ?
isZeroAmount :: Amount -> Bool
isZeroAmount a@(Amount c _ ) = nonzerodigits == ""
where
nonzerodigits = filter (flip notElem "-+,.0") quantitystr
quantitystr = withoutsymbol $ showAmount a
withoutsymbol = drop (length $ symbol c) -- XXX
where nonzerodigits = filter (`elem` "123456789") $ showAmount a
instance Num Amount where
abs (Amount c q) = Amount c (abs q)