]> gitweb.michael.orlitzky.com - dead/census-tools.git/commitdiff
Added the is_negative_float() method to the StringUtils module.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 16 Sep 2009 03:05:48 +0000 (23:05 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 16 Sep 2009 03:05:48 +0000 (23:05 -0400)
src/StringUtils.py

index dcb16c12f19f71c229088077eb0c4465ba92ced2..96e07ea12a42430b79cb7f14b9500ad9f283c42c 100644 (file)
@@ -12,3 +12,7 @@ def is_float(s):
         return True
     except:
         return False
+
+
+def is_negative_float(s):
+    return (is_float(s) and (float(s) < 0.0))