X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FStringUtils.py;h=96e07ea12a42430b79cb7f14b9500ad9f283c42c;hb=5485afbd4da2182072ef9756c65137729bf1eee5;hp=871f3fc7370b6b076c2c6c68194bfbf352b2906f;hpb=75ac117b996561aea48d7c30c2ebdb6db8177c14;p=dead%2Fcensus-tools.git diff --git a/src/StringUtils.py b/src/StringUtils.py index 871f3fc..96e07ea 100644 --- a/src/StringUtils.py +++ b/src/StringUtils.py @@ -4,4 +4,15 @@ def is_integer(s): return True except: return False - + + +def is_float(s): + try: + x = float(s) + return True + except: + return False + + +def is_negative_float(s): + return (is_float(s) and (float(s) < 0.0))