Mono Class Library: System.Double Overview | Members

System.Double.Parse Method

Returns the specified string converted to a double value.

public static double Parse (string s, IFormatProvider provider)

Parameters

s
A string containing the value to convert. The string is interpreted using the System.Globalization.NumberStyles.Float and/or System.Globalization.NumberStyles.AllowThousands style.
provider
A IFormatProvider that supplies a System.Globalization.NumberFormatInfo containing culture-specific formatting information about s.

Returns

The double value obtained from s. If s equals System.Globalization.NumberFormatInfo.NaNSymbol, this method returns double.NaN .

Exceptions

TypeReason
ArgumentNullExceptions is a null reference.
FormatExceptions is not in the correct style.
OverflowExceptions represents a value that is less than double.MinValue or greater than double.MaxValue.

Remarks

This version of double.Parse(string) is equivalent to double.Parse(string)(s, System.Globalization.NumberStyles.Float| System.Globalization.NumberStyles.AllowThousands , provider).

The string s is parsed using the culture-specific formatting information from the System.Globalization.NumberFormatInfo instance supplied by provider. If provider is null or a System.Globalization.NumberFormatInfo cannot be obtained from provider , the formatting information for the current system culture is used.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0