summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-09-25 14:30:32 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-09-25 14:30:32 +0200
commit73d595de982145f27d94ed5711aab65f844d87ab (patch)
tree1fee3ef8834147ea953399f7c69a1bc98a1804fe
parent67ac62c0264cbe37c1a096ff7765ecdddaba853a (diff)
is_numeric: Also accept float values
-rw-r--r--lib/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils.py b/lib/utils.py
index f54fb99..d8df9cd 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -14,11 +14,11 @@ def vprint(verbose, string):
print(string)
def is_numeric(n):
- """Check if `n` is numeric (i.e., it can be converted to int)."""
+ """Check if `n` is numeric (i.e., it can be converted to float)."""
if n == None:
return False
try:
- int(n)
+ float(n)
return True
except ValueError:
return False