1
0
Fork 0
mirror of https://github.com/Andre0512/pyhOn.git synced 2025-01-10 20:15:28 +00:00
pyhOn/pyhon/helper.py
2023-06-28 19:02:11 +02:00

6 lines
159 B
Python

def str_to_float(string: str | float) -> float:
try:
return int(string)
except ValueError:
return float(str(string).replace(",", "."))