|
59 | 59 | <Docs>
|
60 | 60 | <summary>Determines the styles permitted in numeric string arguments that are passed to the <see langword="Parse" /> and <see langword="TryParse" /> methods of the integral and floating-point numeric types.</summary>
|
61 | 61 | <remarks>
|
62 |
| - <format type="text/markdown"><![CDATA[ |
63 |
| - |
64 |
| -## Remarks |
65 |
| - The <xref:System.Globalization.NumberStyles> enumeration consists of two kinds of enumeration values that are used to parse the string representations of numeric values: |
66 |
| - |
67 |
| -- Individual field flags, which define specific style elements (such as white space and group separators) that can be present in the parsed string. |
68 |
| - |
69 |
| -- Composite number styles, which consist of multiple field flags that define the style elements that can be present in the parsed string. |
70 |
| - |
71 |
| - Except for `AllowHexSpecifier`, the individual field flags in the <xref:System.Globalization.NumberStyles> enumeration define style elements that are used when parsing the string representation of a decimal number. `None` indicates that only digits can be present in the parsed string. The remaining individual field flags define style elements that may be, but do not have to be, present in the string representation of a decimal number for the parse operation to succeed. In contrast, the `AllowHexSpecifier` flag indicates that the string to be parsed is always interpreted as a hexadecimal value. The only individual field flags that can be used with `AllowHexSpecifier` are `AllowLeadingWhite` and `AllowTrailingWhite`. The <xref:System.Globalization.NumberStyles> enumeration includes a composite number style, `HexNumber`, that consists of all three flags. |
72 |
| - |
73 |
| - The symbols (such as the currency symbol, the group separator, the decimal separator, and the positive and negative signs) that can appear in the string to be parsed are defined by the members of the <xref:System.Globalization.NumberFormatInfo?displayProperty=nameWithType> object that is passed either implicitly or explicitly to the `Parse` method. The members table in this topic provides a description of each individual flag and indicates its relationship to <xref:System.Globalization.NumberFormatInfo> properties. |
74 |
| - |
75 |
| - The following table lists the composite number styles and indicates which individual field flags they include. A "1" in a cell indicates that the composite number style includes the individual number style in that row. A "0" indicates that the composite number style does not include the individual number style. |
76 |
| - |
77 |
| -||Any|Currency|Float|Integer|Number|HexNumber| |
78 |
| -|-|---------|--------------|-----------|-------------|------------|---------------| |
79 |
| -|AllowHexSpecifier (0x0200)|0|0|0|0|0|1| |
80 |
| -|AllowCurrencySymbol (0x0100)|1|1|0|0|0|0| |
81 |
| -|AllowExponent (0x0080)|1|0|1|0|0|0| |
82 |
| -|AllowThousands (0x0040)|1|1|0|0|1|0| |
83 |
| -|AllowDecimalPoint (0x0020)|1|1|1|0|1|0| |
84 |
| -|AllowParentheses (0x0010)|1|1|0|0|0|0| |
85 |
| -|AllowTrailingSign (0x0008)|1|1|0|0|1|0| |
86 |
| -|AllowLeadingSign (0x0004)|1|1|1|1|1|0| |
87 |
| -|AllowTrailingWhite (0x0002)|1|1|1|1|1|1| |
88 |
| -|AllowLeadingWhite (0x0001)|1|1|1|1|1|1| |
89 |
| -||(0x1ff)|(0x17f)|(0x0a7)|(0x007)|(0x06f)|(0x203)| |
90 |
| - |
91 |
| - |
92 |
| - |
93 |
| -## Examples |
94 |
| - This example shows how to parse a string into a 32-bit integer by using various `NumberStyles` flags. |
95 |
| - |
| 62 | + <format type="text/markdown"><![CDATA[ |
| 63 | +
|
| 64 | +## Remarks |
| 65 | + The <xref:System.Globalization.NumberStyles> enumeration consists of two kinds of enumeration values that are used to parse the string representations of numeric values: |
| 66 | +
|
| 67 | +- Individual field flags, which define specific style elements (such as white space and group separators) that can be present in the parsed string. |
| 68 | +
|
| 69 | +- Composite number styles, which consist of multiple field flags that define the style elements that can be present in the parsed string. |
| 70 | +
|
| 71 | + Except for `AllowHexSpecifier`, the individual field flags in the <xref:System.Globalization.NumberStyles> enumeration define style elements that are used when parsing the string representation of a decimal number. `None` indicates that only digits can be present in the parsed string. The remaining individual field flags define style elements that may be, but do not have to be, present in the string representation of a decimal number for the parse operation to succeed. In contrast, the `AllowHexSpecifier` flag indicates that the string to be parsed is always interpreted as a hexadecimal value. The only individual field flags that can be used with `AllowHexSpecifier` are `AllowLeadingWhite` and `AllowTrailingWhite`. The <xref:System.Globalization.NumberStyles> enumeration includes a composite number style, `HexNumber`, that consists of all three flags. |
| 72 | +
|
| 73 | + The symbols (such as the currency symbol, the group separator, the decimal separator, and the positive and negative signs) that can appear in the string to be parsed are defined by the members of the <xref:System.Globalization.NumberFormatInfo?displayProperty=nameWithType> object that is passed either implicitly or explicitly to the `Parse` method. The members table in this topic provides a description of each individual flag and indicates its relationship to <xref:System.Globalization.NumberFormatInfo> properties. |
| 74 | +
|
| 75 | + The following table lists the composite number styles and indicates which individual field flags they include. A "1" in a cell indicates that the composite number style includes the individual number style in that row. A "0" indicates that the composite number style does not include the individual number style. |
| 76 | +
|
| 77 | +||Any|Currency|Float|Integer|Number|HexNumber| |
| 78 | +|-|---------|--------------|-----------|-------------|------------|---------------| |
| 79 | +|AllowHexSpecifier (0x0200)|0|0|0|0|0|1| |
| 80 | +|AllowCurrencySymbol (0x0100)|1|1|0|0|0|0| |
| 81 | +|AllowExponent (0x0080)|1|0|1|0|0|0| |
| 82 | +|AllowThousands (0x0040)|1|1|0|0|1|0| |
| 83 | +|AllowDecimalPoint (0x0020)|1|1|1|0|1|0| |
| 84 | +|AllowParentheses (0x0010)|1|1|0|0|0|0| |
| 85 | +|AllowTrailingSign (0x0008)|1|1|0|0|1|0| |
| 86 | +|AllowLeadingSign (0x0004)|1|1|1|1|1|0| |
| 87 | +|AllowTrailingWhite (0x0002)|1|1|1|1|1|1| |
| 88 | +|AllowLeadingWhite (0x0001)|1|1|1|1|1|1| |
| 89 | +||(0x1ff)|(0x17f)|(0x0a7)|(0x007)|(0x06f)|(0x203)| |
| 90 | +
|
| 91 | +
|
| 92 | +
|
| 93 | +## Examples |
| 94 | + This example shows how to parse a string into a 32-bit integer by using various `NumberStyles` flags. |
| 95 | +
|
96 | 96 | :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/NumberStyles/cpp/NumberStyles.cpp" id="Snippet1":::
|
97 | 97 | :::code language="csharp" source="~/snippets/csharp/System.Globalization/NumberStyles/Overview/NumberStyles.cs" interactive="try-dotnet" id="Snippet1":::
|
98 | 98 | :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/NumberStyles/vb/numberstyles.vb" id="Snippet1":::
|
|
125 | 125 | </ReturnValue>
|
126 | 126 | <MemberValue>1024</MemberValue>
|
127 | 127 | <Docs>
|
128 |
| - <summary>To be added.</summary> |
| 128 | + <summary>Indicates that the numeric string represents a binary value. Valid binary values include the numeric digits 0 and 1. Strings that are parsed using this style do not employ a prefix; <c>0b</c> cannot be used. A string that is parsed with the <see cref="F:System.Globalization.NumberStyles.AllowBinarySpecifier" /> style will always be interpreted as a binary value. The only flags that can be combined with <see cref="F:System.Globalization.NumberStyles.AllowBinarySpecifier" /> are <see cref="F:System.Globalization.NumberStyles.AllowLeadingWhite" /> and <see cref="F:System.Globalization.NumberStyles.AllowTrailingWhite" />. The <see cref="T:System.Globalization.NumberStyles" /> enumeration includes a composite style, <see cref="F:System.Globalization.NumberStyles.BinaryNumber" />, that consists of these three flags.</summary> |
129 | 129 | </Docs>
|
130 | 130 | </Member>
|
131 | 131 | <Member MemberName="AllowCurrencySymbol">
|
|
613 | 613 | </ReturnValue>
|
614 | 614 | <MemberValue>1027</MemberValue>
|
615 | 615 | <Docs>
|
616 |
| - <summary>To be added.</summary> |
| 616 | + <summary>Indicates that the <see cref="F:System.Globalization.NumberStyles.AllowLeadingWhite" />, <see cref="F:System.Globalization.NumberStyles.AllowTrailingWhite" />, and <see cref="F:System.Globalization.NumberStyles.AllowBinarySpecifier" /> styles are used. This is a composite number style.</summary> |
617 | 617 | </Docs>
|
618 | 618 | </Member>
|
619 | 619 | <Member MemberName="Currency">
|
|
0 commit comments