Skip to content

Commit 23841a1

Browse files
add isnot_num function
1 parent e77ab63 commit 23841a1

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

lib/misc/data.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,16 @@ def check_vars( _vars_, _varstype_, _endtext_ = 'Input script not created!'):
213213

214214

215215
return _flag_c_
216+
217+
def isnot_num( _string_):
218+
''' return True if the string is not numeric
219+
'''
220+
_flag_ = True
221+
try:
222+
float( _string_)
223+
_flag_ = False
224+
except ValueError:
225+
pass
226+
return _flag_
227+
228+
# vim:tw=80

0 commit comments

Comments
 (0)