<@U0JT0AG13>: ``` val doubleValue = jsonObject.op...
# announcements
k
@reza.shah:
Copy code
val doubleValue = jsonObject.optionalScalarValue<Double>("value")

inline fun <reified T : Any> JsonObject.optionalScalarValue(field: String): T? {
    val element = get(field)

    return when(T::class.java) {
        Double::class.java ->  element.asDouble as? T
        else -> null
    }
}