Returns the specified string converted to a float value.
- s
- A string containing the value to convert. The string is interpreted using the style specified by style .
- style
- Zero or more System.Globalization.NumberStyles values that specify the style of s. Specify multiple values for style using the bitwise OR operator. If style is a null reference, the string is interpreted using the System.Globalization.NumberStyles.Float and System.Globalization.NumberStyles.AllowThousands styles.
- provider
- A IFormatProvider that supplies a System.Globalization.NumberFormatInfo containing culture-specific formatting information about s.
The float value obtained from s. If s equals System.Globalization.NumberFormatInfo.NaNSymbol, this method returns NaN.
Type Reason ArgumentNullException s is a null reference. FormatException s is not in the correct style. OverflowException s represents a value that is less than float.MinValue or greater than float.MaxValue.
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.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0