str to num
(string)
| 127 | |
| 128 | |
| 129 | def str_to_num(string): |
| 130 | """str to num""" |
| 131 | try: |
| 132 | float_val = float(cn_to_an(string)) |
| 133 | if int(float_val) == float_val: |
| 134 | return str(int(float_val)) |
| 135 | else: |
| 136 | return str(float_val) |
| 137 | except ValueError: |
| 138 | return None |
| 139 | |
| 140 | |
| 141 | def str_to_year(string): |
no test coverage detected