Udostępnij za pośrednictwem


JSONObject.OptDouble Method

Definition

Overloads

OptDouble(String)

Returns the value mapped by name if it exists and is a double or can be coerced to a double, or NaN otherwise.

OptDouble(String, Double)

Returns the value mapped by name if it exists and is a double or can be coerced to a double, or fallback otherwise.

OptDouble(String)

Returns the value mapped by name if it exists and is a double or can be coerced to a double, or NaN otherwise.

[Android.Runtime.Register("optDouble", "(Ljava/lang/String;)D", "GetOptDouble_Ljava_lang_String_Handler")]
public virtual double OptDouble (string? name);
[<Android.Runtime.Register("optDouble", "(Ljava/lang/String;)D", "GetOptDouble_Ljava_lang_String_Handler")>]
abstract member OptDouble : string -> double
override this.OptDouble : string -> double

Parameters

name
String

Returns

Attributes

Remarks

Returns the value mapped by name if it exists and is a double or can be coerced to a double, or NaN otherwise.

Java documentation for org.json.JSONObject.optDouble(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

OptDouble(String, Double)

Returns the value mapped by name if it exists and is a double or can be coerced to a double, or fallback otherwise.

[Android.Runtime.Register("optDouble", "(Ljava/lang/String;D)D", "GetOptDouble_Ljava_lang_String_DHandler")]
public virtual double OptDouble (string? name, double fallback);
[<Android.Runtime.Register("optDouble", "(Ljava/lang/String;D)D", "GetOptDouble_Ljava_lang_String_DHandler")>]
abstract member OptDouble : string * double -> double
override this.OptDouble : string * double -> double

Parameters

name
String
fallback
Double

Returns

Attributes

Remarks

Returns the value mapped by name if it exists and is a double or can be coerced to a double, or fallback otherwise.

Java documentation for org.json.JSONObject.optDouble(java.lang.String, double).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to