In This Article

ObjectExtensions Class

Provides extension methods for the object type.

public static class ObjectExtensions
Inheritance:
object object

Methods

TryConvertToDouble(object?, out double)

Tries to convert an object to a double value, using the current thread's NumberFormat.

public static bool TryConvertToDouble(this object? value, out double doubleValue)
Parameter Type Description
value object

The value to examine.

doubleValue double

The converted double value.

Returns

bool:

true if the conversion was successful; otherwise, false.

TryConvertToDouble(object?, IFormatProvider?, out double)

Tries to convert an object to a double value, using the specified IFormatProvider.

public static bool TryConvertToDouble(this object? value, IFormatProvider? provider, out double doubleValue)
Parameter Type Description
value object

The value to examine.

provider IFormatProvider

The IFormatProvider to use, which uses the current thread's NumberFormat when null.

doubleValue double

The converted double value.

Returns

bool:

true if the conversion was successful; otherwise, false.

Inherited Members