treatsAsFloat

fun JsonElement?.treatsAsFloat(defValue: Float = 0.0f): Float

Method used to treats a JsonElement value as null-safe Float

Return

the JsonElement as null-safe Float

Parameters

defValue

The default value to return if the JsonElement is null or is not a Float value