11 Aug 2009 10:51
[gnue] r9915 - trunk/gnue-common/src/formatting
<reinhard <at> gnuenterprise.org>
2009-08-11 08:51:27 GMT
2009-08-11 08:51:27 GMT
Author: reinhard
Date: 2009-08-11 03:51:27 -0500 (Tue, 11 Aug 2009)
New Revision: 9915
Modified:
trunk/gnue-common/src/formatting/GDataFormatter.py
Log:
Also check for decimal.Decimal type. Thanks to John Proios.
Modified: trunk/gnue-common/src/formatting/GDataFormatter.py
===================================================================
--- trunk/gnue-common/src/formatting/GDataFormatter.py 2009-04-03 10:19:49 UTC (rev 9914)
+++ trunk/gnue-common/src/formatting/GDataFormatter.py 2009-08-11 08:51:27 UTC (rev 9915)
<at> <at> -30,6 +30,7 <at> <at>
#
from types import *
+import decimal
from gnue.common.external.fixedpoint import FixedPoint, addHalfAndChop
FixedPoint.round = addHalfAndChop
<at> <at> -49,7 +50,7 <at> <at>
pass
# TODO: As said above, this is a bad hack w/a lot of assumptions
- if type(value) == FloatType:
+ if type(value) == FloatType or isinstance(value, decimal.Decimal):
v = mask.split('.',1)
try:
dec = len(v[1])
(Continue reading)
RSS Feed