toFloatOrNull

Returns content as Float only if it can be an exact Float or inf/+inf/-inf/nan, otherwise null.