]> gitweb.michael.orlitzky.com - dead/census-tools.git/commitdiff
Added the is_float() method to the StringUtils module.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 12 Sep 2009 15:00:27 +0000 (11:00 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 12 Sep 2009 15:00:27 +0000 (11:00 -0400)
src/StringUtils.py

index 871f3fc7370b6b076c2c6c68194bfbf352b2906f..dcb16c12f19f71c229088077eb0c4465ba92ced2 100644 (file)
@@ -4,4 +4,11 @@ def is_integer(s):
         return True
     except:
         return False
-    
+
+
+def is_float(s):
+    try:
+        x = float(s)
+        return True
+    except:
+        return False