#endif
representation :: String
-null :: Quantity
-is_zero :: Word8 -> Quantity -> Bool
+nil :: Quantity
+is_zero :: Quantity -> Bool
round :: Word8 -> Quantity -> Quantity
#ifdef DOUBLE
representation = "Double"
-null = 0.0
+nil = 0.0
-round :: fromInteger $ round $ (f * (10^n)) / (10.0^^n)
+round n f = fromInteger $ round $ (f * (10^n)) / (10.0^^n)
-is_zero decimal_places quantity =
- floor quantity == 0 && -- NOTE: check integral part, in case of an overflow in roundTo'
- 0 == roundTo' decimal_places quantity
- where
- roundTo' n f = fromInteger $ round $ f * (10 ^ n)
+is_zero = (== 0) . decimalMantissa
+--is_zero decimal_places quantity =
+-- floor quantity == 0 && -- NOTE: check integral part, in case of an overflow in roundTo'
+-- 0 == roundTo' decimal_places quantity
+-- where
+-- roundTo' n f = fromInteger $ round $ f * (10 ^ n)
#else
representation = "Decimal"
-null = fromInteger 0
+nil = fromInteger 0
round = Data.Decimal.roundTo
-is_zero decimal_places quantity =
- (== 0) $ decimalMantissa $
- Hcompta.Model.Amount.Quantity.round decimal_places quantity
+is_zero = (== 0) . decimalMantissa
+--is_zero decimal_places quantity =
+-- (== 0) $ decimalMantissa $
+-- Hcompta.Model.Amount.Quantity.round decimal_places quantity
#endif