Mono Class Library: System.Globalization NamespaceSystem.Globalization.NumberStyles Enumeration |
|
System.Globalization.NumberStyles define the presence and/or location of various elements in a string representation of a numeric value.
Note: For example, the NumberStyles.AllowParentheses style describes strings where the numeric value is enclosed in parenthesis, such as "(432.00)".Note:[Edit]Where symbols such as a currency symbol are allowed in a System.Globalization.NumberStyles pattern, a System.Globalization.NumberFormatInfo instance defines the string representations of the symbols.
System.Globalization.NumberStyles values are passed to methods that convert between string and numeric data types, such as the Parse methods implemented by numeric base types. To specify multiple System.Globalization.NumberStyles values, use the bitwise OR operator.
For a list of the valid white space characters, see the string class.
Member Name Description AllowCurrencySymbol Specifies that a currency symbol is allowed. Note: See NumberFormatInfo.CurrencySymbol .[Edit]AllowDecimalPoint Specifies that a decimal point is allowed. Note: See NumberFormatInfo.NumberDecimalSeparator, NumberFormatInfo.PercentDecimalSeparator, and NumberFormatInfo.CurrencyDecimalSeparator .[Edit]AllowExponent Specifies that exponential notation is allowed.
This style is used for values in one of the following forms:
[-]m.ddddddE+xx
[-]m.ddddddE-xx
[-]m.dddddde+xx
[-]m.dddddde-xx
One or more non-zero digits (m) precede the decimal separator ("."). A minus sign ("-") can precede m. The type performing the conversion determines the number of decimal places (dddddd) in the string, and maximum and minimum values for xx and m. The exponent (+/-xx) consists of either a plus or minus sign followed by at least one digit.
[Edit]AllowHexSpecifier Specifies that hexadecimal representation (Base 16) is allowed.
Valid hexadecimal values include the numeric digits 0-9 and the hexadecimal digits A-F, and a-f. The hexadecimal digits can be in upper or lower case. Hexadecimal values can be left-padded with zeros. Strings parsed using this style are not permitted to be prefixed with "0x".
[Edit]AllowLeadingSign Specifies that a leading sign symbol is allowed. Note: See NumberFormatInfo.PositiveSign and NumberFormatInfo.NegativeSign .[Edit]AllowLeadingWhite Specifies that the string can be prefixed with white space characters. [Edit] AllowParentheses Specifies that one pair of balanced parentheses is allowed. [Edit] AllowThousands Specifies that group separators are allowed; for instance, separating the hundreds from the thousands. Note: See NumberFormatInfo.NumberGroupSeparator, NumberFormatInfo.PercentGroupSeparator, and NumberFormatInfo.CurrencyGroupSeparator .[Edit]AllowTrailingSign Specifies that a trailing sign symbol is allowed. Note: See NumberFormatInfo.PositiveSign and NumberFormatInfo.NegativeSign .[Edit]AllowTrailingWhite Specifies that the string can be suffixed with white space characters. [Edit] Any Specifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, NumberStyles.AllowLeadingSign, NumberStyles.AllowTrailingSign, NumberStyles.AllowParentheses, NumberStyles.AllowDecimalPoint, NumberStyles.AllowThousands, NumberStyles.AllowCurrencySymbol and NumberStyles.AllowExponent styles are allowed. [Edit] Currency Specifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, NumberStyles.AllowLeadingSign, NumberStyles.AllowTrailingSign, NumberStyles.AllowParentheses, NumberStyles.AllowDecimalPoint, NumberStyles.AllowThousands, and NumberStyles.AllowCurrencySymbol styles are allowed. [Edit] Float Specifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, NumberStyles.AllowLeadingSign, NumberStyles.AllowDecimalPoint and NumberStyles.AllowExponent styles are allowed. [Edit] HexNumber Specifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, NumberStyles.AllowHexSpecifier styles are allowed. [Edit] Integer Specifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, and NumberStyles.AllowLeadingSign styles are allowed. [Edit] None Specifies that no styles are allowed. [Edit] Number Specifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, NumberStyles.AllowLeadingSign, NumberStyles.AllowTrailingSign, NumberStyles.AllowDecimalPoint and NumberStyles.AllowThousands styles are allowed. [Edit]
Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0