Condividi tramite


JSONArray.OptDouble Method

Definition

Overloads

OptDouble(Int32, Double)

Returns the value at index if it exists and is a double or can be coerced to a double.

OptDouble(Int32)

Returns the value at index if it exists and is a double or can be coerced to a double.

OptDouble(Int32, Double)

Returns the value at index if it exists and is a double or can be coerced to a double.

[Android.Runtime.Register("optDouble", "(ID)D", "GetOptDouble_IDHandler")]
public virtual double OptDouble (int index, double fallback);
[<Android.Runtime.Register("optDouble", "(ID)D", "GetOptDouble_IDHandler")>]
abstract member OptDouble : int * double -> double
override this.OptDouble : int * double -> double

Parameters

index
Int32
fallback
Double

Returns

Attributes

Remarks

Returns the value at index if it exists and is a double or can be coerced to a double. Returns fallback otherwise.

Java documentation for org.json.JSONArray.optDouble(int, 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

OptDouble(Int32)

Returns the value at index if it exists and is a double or can be coerced to a double.

[Android.Runtime.Register("optDouble", "(I)D", "GetOptDouble_IHandler")]
public virtual double OptDouble (int index);
[<Android.Runtime.Register("optDouble", "(I)D", "GetOptDouble_IHandler")>]
abstract member OptDouble : int -> double
override this.OptDouble : int -> double

Parameters

index
Int32

Returns

Attributes

Remarks

Returns the value at index if it exists and is a double or can be coerced to a double. Returns NaN otherwise.

Java documentation for org.json.JSONArray.optDouble(int).

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