make isZeroAmount more robust, fix timelog balance total
This commit is contained in:
		
							parent
							
								
									f99963786c
								
							
						
					
					
						commit
						3dca1ca548
					
				| @ -75,10 +75,7 @@ showAmountOrZero a | |||||||
| -- | is this amount zero, when displayed with its given precision ? | -- | is this amount zero, when displayed with its given precision ? | ||||||
| isZeroAmount :: Amount -> Bool | isZeroAmount :: Amount -> Bool | ||||||
| isZeroAmount a@(Amount c _ ) = nonzerodigits == "" | isZeroAmount a@(Amount c _ ) = nonzerodigits == "" | ||||||
|     where |     where nonzerodigits = filter (`elem` "123456789") $ showAmount a | ||||||
|       nonzerodigits = filter (flip notElem "-+,.0") quantitystr |  | ||||||
|       quantitystr = withoutsymbol $ showAmount a |  | ||||||
|       withoutsymbol = drop (length $ symbol c) -- XXX |  | ||||||
| 
 | 
 | ||||||
| instance Num Amount where | instance Num Amount where | ||||||
|     abs (Amount c q) = Amount c (abs q) |     abs (Amount c q) = Amount c (abs q) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user