Mono Class Library: System.Globalization Namespace

System.Globalization.NumberStyles Enumeration

Specifies styles for string representations of numeric values. [Edit]
[System.Flags]
[System.Runtime.InteropServices.ComVisible(true)]
public enum NumberStyles

Remarks

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:

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.

[Edit]

Members

Member NameDescription
AllowCurrencySymbolSpecifies that a currency symbol is allowed. [Edit]
AllowDecimalPointSpecifies that a decimal point is allowed. [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]
AllowLeadingSignSpecifies that a leading sign symbol is allowed. [Edit]
AllowLeadingWhiteSpecifies that the string can be prefixed with white space characters. [Edit]
AllowParenthesesSpecifies that one pair of balanced parentheses is allowed. [Edit]
AllowThousandsSpecifies that group separators are allowed; for instance, separating the hundreds from the thousands. [Edit]
AllowTrailingSignSpecifies that a trailing sign symbol is allowed. [Edit]
AllowTrailingWhiteSpecifies that the string can be suffixed with white space characters. [Edit]
AnySpecifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, NumberStyles.AllowLeadingSign, NumberStyles.AllowTrailingSign, NumberStyles.AllowParentheses, NumberStyles.AllowDecimalPoint, NumberStyles.AllowThousands, NumberStyles.AllowCurrencySymbol and NumberStyles.AllowExponent styles are allowed. [Edit]
CurrencySpecifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, NumberStyles.AllowLeadingSign, NumberStyles.AllowTrailingSign, NumberStyles.AllowParentheses, NumberStyles.AllowDecimalPoint, NumberStyles.AllowThousands, and NumberStyles.AllowCurrencySymbol styles are allowed. [Edit]
FloatSpecifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, NumberStyles.AllowLeadingSign, NumberStyles.AllowDecimalPoint and NumberStyles.AllowExponent styles are allowed. [Edit]
HexNumberSpecifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, NumberStyles.AllowHexSpecifier styles are allowed. [Edit]
IntegerSpecifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, and NumberStyles.AllowLeadingSign styles are allowed. [Edit]
NoneSpecifies that no styles are allowed. [Edit]
NumberSpecifies that NumberStyles.AllowLeadingWhite, NumberStyles.AllowTrailingWhite, NumberStyles.AllowLeadingSign, NumberStyles.AllowTrailingSign, NumberStyles.AllowDecimalPoint and NumberStyles.AllowThousands styles are allowed. [Edit]

Requirements

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