Elm 0.19 changed the signatures of toInt and toFloat.
Try to convert a string into a float, failing on improperly formatted strings.
String018.toFloat "123" --> Ok 123.0
String018.toFloat "-42" --> Ok -42.0
String018.toFloat "3.1" --> Ok 3.1
String018.toFloat "31a" --> Err "could not convert string '31a' to a Float"If you are extracting a number from some raw user input, you will typically
want to use Result.withDefault to handle bad data:
Result.withDefault 0 (String018.toFloat "42.5") == 42.5
Result.withDefault 0 (String018.toFloat "cats") == 0
Try to convert a string into an int, failing on improperly formatted strings.
If you are extracting a number from some raw user input, you will typically want to use
Result.withDefaultto handle bad data: