commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r9101 - trunk/gnue-common/src/utils


From: reinhard
Subject: [gnue] r9101 - trunk/gnue-common/src/utils
Date: Mon, 4 Dec 2006 08:09:35 -0600 (CST)

Author: reinhard
Date: 2006-12-04 08:09:35 -0600 (Mon, 04 Dec 2006)
New Revision: 9101

Modified:
   trunk/gnue-common/src/utils/datatypes.py
Log:
A scale of "None" means unlimited number of fractional digits.


Modified: trunk/gnue-common/src/utils/datatypes.py
===================================================================
--- trunk/gnue-common/src/utils/datatypes.py    2006-12-04 14:05:49 UTC (rev 
9100)
+++ trunk/gnue-common/src/utils/datatypes.py    2006-12-04 14:09:35 UTC (rev 
9101)
@@ -43,8 +43,10 @@
     @param value: The value to convert.
     @param datatype: Can be "text", "number", "date", "time", "datetime", or
         "boolean".
-    @param length: Length for "text" and "number" datatypes.
-    @param scale: Scale for "number" datatype.
+    @param length: Length for "text" and "number" datatypes. C{None} means
+        "unlimited" number of digits.
+    @param scale: Scale for "number" datatype. C{None} means "unlimited" number
+        of fractional digits.
     """
 
     # It might be better style to have separate functions "convert_text",
@@ -65,7 +67,7 @@
             result = unicode(str(value))
 
     elif datatype == "number":
-        if scale:
+        if scale is None or scale > 0:
             result = float(value)
         else:
             result = int(value)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]