doubleValue

fun JsonElement.doubleValue(vararg keys: String): Double

Navigates to the nested element at keys and returns its double value. Extension function on JsonElement.


val JsonElement.doubleValue: Double

Returns the double value of this JsonElement's primitive content. Extension property on JsonElement.

The content, quoted or not, must follow JSON number syntax or be NaN, Infinity or -Infinity, so every platform gives the same answer.

Throws

if this element is JSON null, not a primitive, or not a number