diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-09-25 14:30:32 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-09-25 14:30:32 +0200 |
commit | 73d595de982145f27d94ed5711aab65f844d87ab (patch) | |
tree | 1fee3ef8834147ea953399f7c69a1bc98a1804fe /lib/utils.py | |
parent | 67ac62c0264cbe37c1a096ff7765ecdddaba853a (diff) |
is_numeric: Also accept float values
Diffstat (limited to 'lib/utils.py')
-rw-r--r-- | lib/utils.py | 4 |
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 |