You can use the `Float()` method to handle this for you:

```
[1] pry(main)> Float('1.0')
=> 1.0
[2] pry(main)> Float('-1.5')
=> -1.5
[3] pry(main)> Float('0')
=> 0.0
[4] pry(main)> Float('not a float')
ArgumentError: invalid value for Float(): "not a float"
from (pry):4:in `Float'
```