pyhOn/pyhon/helper.py

6 lines
159 B
Python
Raw Permalink Normal View History

2023-06-12 22:12:29 +00:00
def str_to_float(string: str | float) -> float:
try:
return int(string)
except ValueError:
return float(str(string).replace(",", "."))