Basic usage

The _.toFloat function will do its best to convert the given value to a float.

import { toFloat } from 'radash'

toFloat(0) // => 0.0
toFloat(null) // => 0.0
toFloat(null, 3.33) // => 3.33

Testing

This _.toFloat function is 100% covered by tests. See them and contribute at GitHub.

Source

See the source for _.toFloat on GitHub.