JsonObject.GetNamedNumber Method

Definition

Overloads

GetNamedNumber(String)

Gets the number value (a Double) with the specified name.

GetNamedNumber(String, Double)

Gets the number value (a Double) with the specified name, or the provided default value if no such named value is found.

GetNamedNumber(String)

Gets the number value (a Double) with the specified name.

C#
public double GetNamedNumber(string name);

Parameters

name
String

The name.

Returns

Double

The Double with the specified name.

Remarks

This method should always used with a try/catch block because it throws an exception if the name found is not a Double type or the name is not found.

See also

Applies to

WinRT Build 26100 and other versions
Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

GetNamedNumber(String, Double)

Gets the number value (a Double) with the specified name, or the provided default value if no such named value is found.

C#
[Windows.Foundation.Metadata.Overload("GetNamedNumberOrDefault")]
public double GetNamedNumber(string name, double defaultValue);

Parameters

name
String

The name.

defaultValue
Double

The default value to use if the JSON property is not found.

Returns

Double

The Double with the specified name, or if this value wasn't found, the defaultValue is returned.

Attributes

See also

Applies to

WinRT Build 26100 and other versions
Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100