This overload is typically used to convert text that can be formatted in a variety of ways to a Single value. For example, it can be used to convert the text entered by a user into an HTML text box to a numeric value.
The s parameter can contain PositiveInfinitySymbol, NegativeInfinitySymbol, NaNSymbol, or a string of the form:
[ws][sign]integral-digits[.[fractional-digits]][e[sign]exponential-digits][ws]
Optional items are framed in square brackets ([ and ]). Items containing the term "digits" consist of a series of numeric characters ranging from 0 to 9.
- ws
A series of white space characters.
- sign
A negative sign or positive sign symbol.
- integral-digits
A series of digits specifying the integral part of the number. Runs of integral-digits can be partitioned by a group-separator symbol. (For example, in some cultures a comma (,) separates groups of thousands.) Integral-digits can be absent if there are fractional-digits.
- '.'
A culture-specific decimal point symbol.
- fractional-digits
A series of digits specifying the fractional part of the number.
- 'e'
An uppercase or lowercase character 'e', indicating exponential (scientific) notation.
- exponential-digits
A series of digits specifying an exponent.
Some examples of s are "100", "-123,456,789", "123.45e+6", "+500", "5e2", "3.1416", "600.", "-.123", and "-Infinity".
This overload of Parse uses the NumberStyles..::.Float and NumberStyles..::.AllowThousands values and the number format information specified by provider. If provider is nullNothingnullptra null reference (Nothing in Visual Basic) or a NumberFormatInfo cannot be obtained, the formatting information for the current system culture is used.
For more information about numeric formats, see the Formatting Overview topic.
If a separator is encountered in the s parameter during a parse operation, and the applicable currency or number decimal and group separators are the same, the parse operation assumes that the separator is a decimal separator rather than a group separator. For more information about separators, see CurrencyDecimalSeparator, NumberDecimalSeparator, CurrencyGroupSeparator, and NumberGroupSeparator.