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:
trueif 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 |
| doubleValue | double | The converted double value. |
Returns
- bool:
trueif the conversion was successful; otherwise,false.