From 001156acd12c94e565a1c7f27d52a2f20dd1b516 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 12 Sep 2009 11:00:27 -0400 Subject: [PATCH 1/1] Added the is_float() method to the StringUtils module. --- src/StringUtils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.44.2