Sdílet prostřednictvím


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.

public:
 virtual double GetNamedNumber(Platform::String ^ name) = GetNamedNumber;
double GetNamedNumber(winrt::hstring const& name);
public double GetNamedNumber(string name);
function getNamedNumber(name)
Public Function GetNamedNumber (name As String) As Double

Parameters

name
String

Platform::String

winrt::hstring

The name.

Returns

Double

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

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.

public:
 virtual double GetNamedNumber(Platform::String ^ name, double defaultValue) = GetNamedNumber;
/// [Windows.Foundation.Metadata.Overload("GetNamedNumberOrDefault")]
double GetNamedNumber(winrt::hstring const& name, double const& defaultValue);
[Windows.Foundation.Metadata.Overload("GetNamedNumberOrDefault")]
public double GetNamedNumber(string name, double defaultValue);
function getNamedNumber(name, defaultValue)
Public Function GetNamedNumber (name As String, defaultValue As Double) As Double

Parameters

name
String

Platform::String

winrt::hstring

The name.

defaultValue
Double

double

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

Returns

Double

double

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

Attributes

See also

Applies to