System.Globalization.NumberStyles Enum

public enum NumberStyles

Base Types

Object
  ValueType
    Enum
      NumberStyles

Assembly

mscorlib

Library

BCL

Summary

Specifies styles for String representations of numeric values.

Description

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.

]

Attributes

FlagsAttribute

See Also

System.Globalization Namespace

Members

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


NumberStyles.AllowCurrencySymbol Field

AllowCurrencySymbol = 0x100;

Summary

Specifies that a currency symbol is allowed. [Note: See System.Globalization.NumberFormatInfo.CurrencySymbol .]

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.AllowDecimalPoint Field

AllowDecimalPoint = 0x20;

Summary

Specifies that a decimal point is allowed. [Note: See System.Globalization.NumberFormatInfo.NumberDecimalSeparator, System.Globalization.NumberFormatInfo.PercentDecimalSeparator, and System.Globalization.NumberFormatInfo.CurrencyDecimalSeparator .]

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.AllowExponent Field

AllowExponent = 0x80;

Summary

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.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.AllowHexSpecifier Field

AllowHexSpecifier = 0x200;

Summary

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".

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.AllowLeadingSign Field

AllowLeadingSign = 0x4;

Summary

Specifies that a leading sign symbol is allowed. [Note: See System.Globalization.NumberFormatInfo.PositiveSign and System.Globalization.NumberFormatInfo.NegativeSign .]

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.AllowLeadingWhite Field

AllowLeadingWhite = 0x1;

Summary

Specifies that the string can be prefixed with white space characters.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.AllowParentheses Field

AllowParentheses = 0x10;

Summary

Specifies that one pair of balanced parentheses is allowed.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.AllowThousands Field

AllowThousands = 0x40;

Summary

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 .]

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.AllowTrailingSign Field

AllowTrailingSign = 0x8;

Summary

Specifies that a trailing sign symbol is allowed. [Note: See System.Globalization.NumberFormatInfo.PositiveSign and System.Globalization.NumberFormatInfo.NegativeSign .]

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.AllowTrailingWhite Field

AllowTrailingWhite = 0x2;

Summary

Specifies that the string can be suffixed with white space characters.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.Any Field

Any = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign | AllowParentheses | AllowDecimalPoint | AllowThousands | AllowExponent | AllowCurrencySymbol;

Summary

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.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.Currency Field

Currency = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign | AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol;

Summary

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.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.Float Field

Float = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowDecimalPoint | AllowExponent;

Summary

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.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.HexNumber Field

HexNumber = AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier;

Summary

Specifies that System.Globalization.NumberStyles.AllowLeadingWhite, System.Globalization.NumberStyles.AllowTrailingWhite, System.Globalization.NumberStyles.AllowHexSpecifier styles are allowed.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.Integer Field

Integer = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign;

Summary

Specifies that System.Globalization.NumberStyles.AllowLeadingWhite, System.Globalization.NumberStyles.AllowTrailingWhite, and System.Globalization.NumberStyles.AllowLeadingSign styles are allowed.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.None Field

None = 0x0;

Summary

Specifies that no styles are allowed.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.Number Field

Number = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign | AllowDecimalPoint | AllowThousands;

Summary

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.

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace

NumberStyles.value__ Field

value__;

See Also

System.Globalization.NumberStyles Enum, System.Globalization Namespace