From 73d595de982145f27d94ed5711aab65f844d87ab Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 25 Sep 2019 14:30:32 +0200 Subject: is_numeric: Also accept float values --- lib/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/utils.py') 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 -- cgit v1.2.3