public enum NumberStyles
Object
ValueType
Enum
NumberStyles
mscorlib
BCL
Specifies styles for String representations of numeric values.
NumberStyles define the presence and/or location of various elements in a String representation of a numeric value. [Note: For example, the System.Globalization.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 NumberStyles pattern, a NumberFormatInfo instance defines the String representations of the symbols.
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 NumberStyles values, use the bitwise OR operator.For a list of the valid white space characters, see the String class.
]
FlagsAttribute
System.Globalization Namespace
NumberStyles Fields
NumberStyles.AllowCurrencySymbol Field
NumberStyles.AllowDecimalPoint Field
NumberStyles.AllowExponent Field
NumberStyles.AllowHexSpecifier Field
NumberStyles.AllowLeadingSign Field
NumberStyles.AllowLeadingWhite Field
NumberStyles.AllowParentheses Field
NumberStyles.AllowThousands Field
NumberStyles.AllowTrailingSign Field
NumberStyles.AllowTrailingWhite Field
NumberStyles.Any Field
NumberStyles.Currency Field
NumberStyles.Float Field
NumberStyles.HexNumber Field
NumberStyles.Integer Field
NumberStyles.None Field
NumberStyles.Number Field
NumberStyles.value__ Field
AllowCurrencySymbol = 0x100;
Specifies that a currency symbol is allowed. [Note: See System.Globalization.NumberFormatInfo.CurrencySymbol .]
System.Globalization.NumberStyles Enum, System.Globalization Namespace
AllowDecimalPoint = 0x20;
Specifies that a decimal point is allowed. [Note: See System.Globalization.NumberFormatInfo.NumberDecimalSeparator, System.Globalization.NumberFormatInfo.PercentDecimalSeparator, and System.Globalization.NumberFormatInfo.CurrencyDecimalSeparator .]
System.Globalization.NumberStyles Enum, System.Globalization Namespace
AllowExponent = 0x80;
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.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
AllowHexSpecifier = 0x200;
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".
System.Globalization.NumberStyles Enum, System.Globalization Namespace
AllowLeadingSign = 0x4;
Specifies that a leading sign symbol is allowed. [Note: See System.Globalization.NumberFormatInfo.PositiveSign and System.Globalization.NumberFormatInfo.NegativeSign .]
System.Globalization.NumberStyles Enum, System.Globalization Namespace
AllowLeadingWhite = 0x1;
Specifies that the string can be prefixed with white space characters.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
AllowParentheses = 0x10;
Specifies that one pair of balanced parentheses is allowed.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
AllowThousands = 0x40;
Specifies that group separators are allowed; for instance, separating the hundreds from the thousands. [Note: See System.Globalization.NumberFormatInfo.NumberGroupSeparator, System.Globalization.NumberFormatInfo.PercentGroupSeparator, and System.Globalization.NumberFormatInfo.CurrencyGroupSeparator .]
System.Globalization.NumberStyles Enum, System.Globalization Namespace
AllowTrailingSign = 0x8;
Specifies that a trailing sign symbol is allowed. [Note: See System.Globalization.NumberFormatInfo.PositiveSign and System.Globalization.NumberFormatInfo.NegativeSign .]
System.Globalization.NumberStyles Enum, System.Globalization Namespace
AllowTrailingWhite = 0x2;
Specifies that the string can be suffixed with white space characters.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
Any = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign | AllowParentheses | AllowDecimalPoint | AllowThousands | AllowExponent | AllowCurrencySymbol;
Specifies that System.Globalization.NumberStyles.AllowLeadingWhite, System.Globalization.NumberStyles.AllowTrailingWhite, System.Globalization.NumberStyles.AllowLeadingSign, System.Globalization.NumberStyles.AllowTrailingSign, System.Globalization.NumberStyles.AllowParentheses, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.NumberStyles.AllowThousands, System.Globalization.NumberStyles.AllowCurrencySymbol and System.Globalization.NumberStyles.AllowExponent styles are allowed.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
Currency = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign | AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol;
Specifies that System.Globalization.NumberStyles.AllowLeadingWhite, System.Globalization.NumberStyles.AllowTrailingWhite, System.Globalization.NumberStyles.AllowLeadingSign, System.Globalization.NumberStyles.AllowTrailingSign, System.Globalization.NumberStyles.AllowParentheses, System.Globalization.NumberStyles.AllowDecimalPoint, System.Globalization.NumberStyles.AllowThousands, and System.Globalization.NumberStyles.AllowCurrencySymbol styles are allowed.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
Float = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowDecimalPoint | AllowExponent;
Specifies that System.Globalization.NumberStyles.AllowLeadingWhite, System.Globalization.NumberStyles.AllowTrailingWhite, System.Globalization.NumberStyles.AllowLeadingSign, System.Globalization.NumberStyles.AllowDecimalPoint and System.Globalization.NumberStyles.AllowExponent styles are allowed.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
HexNumber = AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier;
Specifies that System.Globalization.NumberStyles.AllowLeadingWhite, System.Globalization.NumberStyles.AllowTrailingWhite, System.Globalization.NumberStyles.AllowHexSpecifier styles are allowed.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
Integer = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign;
Specifies that System.Globalization.NumberStyles.AllowLeadingWhite, System.Globalization.NumberStyles.AllowTrailingWhite, and System.Globalization.NumberStyles.AllowLeadingSign styles are allowed.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
None = 0x0;
Specifies that no styles are allowed.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
Number = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign | AllowDecimalPoint | AllowThousands;
Specifies that System.Globalization.NumberStyles.AllowLeadingWhite, System.Globalization.NumberStyles.AllowTrailingWhite, System.Globalization.NumberStyles.AllowLeadingSign, System.Globalization.NumberStyles.AllowTrailingSign, System.Globalization.NumberStyles.AllowDecimalPoint and System.Globalization.NumberStyles.AllowThousands styles are allowed.
System.Globalization.NumberStyles Enum, System.Globalization Namespace
value__;
System.Globalization.NumberStyles Enum, System.Globalization Namespace