ConversionHelpers.ToDouble(Object, CultureInfo, Double) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Converts value
to a Double.
public static double ToDouble (object value, System.Globalization.CultureInfo culture, double defaultValue = NaN);
static member ToDouble : obj * System.Globalization.CultureInfo * double -> double
Public Shared Function ToDouble (value As Object, culture As CultureInfo, Optional defaultValue As Double = NaN) As Double
Parameters
- value
- Object
The value to convert.
- culture
- CultureInfo
If value
is a string, InvariantCulture is first
passed as the second parameter to to ToDouble(Object, IFormatProvider)
to attempt to convert the string to a Double.
If that conversion fails, then this culture is passed as the second parameter to to ToDouble(Object, IFormatProvider) to attempt to convert the string to a Double.
Returns
The converted value. If the conversion fails, defaultValue
is returned.