From: Michael Orlitzky Date: Sat, 12 Sep 2009 15:00:27 +0000 (-0400) Subject: Added the is_float() method to the StringUtils module. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=001156acd12c94e565a1c7f27d52a2f20dd1b516;p=dead%2Fcensus-tools.git Added the is_float() method to the StringUtils module. --- diff --git a/src/StringUtils.py b/src/StringUtils.py index 871f3fc..dcb16c1 100644 --- a/src/StringUtils.py +++ b/src/StringUtils.py @@ -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