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