Is there a method that takes in a float string and converts it to a single float. It must also handle strings without .
like "1"
String.to_float
does not handle "1"
iex(5)> String.to_float("1")
** (ArgumentError) argument error
:erlang.binary_to_float("1")
iex(5)> String.to_float("1.0")
1.0
Float.parse
handles "1"
, but returns a tuple.
iex(4)> Float.parse("1")
{1.0, ""}