asFloat

fun asFloat(defaultValue: Float = 0.0f): Float

Attempts to convert and return the value of this instance as a float. If the conversion is invalid, the default value is returned.

Return

The value of this instance as a float.

Parameters

defaultValue

The default value to return if the conversion is invalid.