(numStr)
| 6 | |
| 7 | |
| 8 | def is_float(numStr): |
| 9 | flag = False |
| 10 | numStr = str(numStr).strip().lstrip('-').lstrip('+') |
| 11 | try: |
| 12 | reg = re.compile(r'^[-+]?[0-9]+\.[0-9]+$') |
| 13 | res = reg.match(str(numStr)) |
| 14 | if res: |
| 15 | flag = True |
| 16 | except Exception as ex: |
| 17 | print("is_float() - error: " + str(ex)) |
| 18 | return flag |
| 19 | |
| 20 | |
| 21 | def is_number(numStr): |