mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-12-01 01:27:17 +01:00
6 lines
159 B
Python
6 lines
159 B
Python
def str_to_float(string: str | float) -> float:
|
|
try:
|
|
return int(string)
|
|
except ValueError:
|
|
return float(str(string).replace(",", "."))
|