Fix markdown

This commit is contained in:
Victor Zverovich
2024-05-30 20:26:19 -07:00
parent e80f4a9b72
commit 191b0cb486

View File

@ -12,7 +12,8 @@ The grammar for a replacement field is as follows:
<a id="replacement-field"></a> <a id="replacement-field"></a>
<pre> <pre>
replacement_field ::= "{" [arg_id] [":" (<a href="#format-spec">format_spec</a> | <a href="#chrono-format-spec">chrono_format_spec</a>)] "}" replacement_field ::= "{" [arg_id] [":" (<a href="#format-spec">format_spec</a
> | <a href="#chrono-format-spec">chrono_format_spec</a>)] "}"
arg_id ::= integer | identifier arg_id ::= integer | identifier
integer ::= digit+ integer ::= digit+
digit ::= "0"..."9" digit ::= "0"..."9"
@ -77,8 +78,10 @@ format_spec ::= [[fill]align][sign]["#"]["0"][width]["." precision]["L"][type]
fill ::= &lt;a character other than '{' or '}'> fill ::= &lt;a character other than '{' or '}'>
align ::= "<" | ">" | "^" align ::= "<" | ">" | "^"
sign ::= "+" | "-" | " " sign ::= "+" | "-" | " "
width ::= <a href="#replacement-field">integer</a> | "{" [<a href="#replacement-field">arg_id</a>] "}" width ::= <a href="#replacement-field">integer</a> | "{" [<a
precision ::= <a href="#replacement-field">integer</a> | "{" [<a href="#replacement-field">arg_id</a>] "}" href="#replacement-field">arg_id</a>] "}"
precision ::= <a href="#replacement-field">integer</a> | "{" [<a
href="#replacement-field">arg_id</a>] "}"
type ::= "a" | "A" | "b" | "B" | "c" | "d" | "e" | "E" | "f" | "F" | type ::= "a" | "A" | "b" | "B" | "c" | "d" | "e" | "E" | "f" | "F" |
"g" | "G" | "o" | "p" | "s" | "x" | "X" | "?" "g" | "G" | "o" | "p" | "s" | "x" | "X" | "?"
</pre> </pre>
@ -92,13 +95,10 @@ the fill character and the alignment option are absent.
The meaning of the various alignment options is as follows: The meaning of the various alignment options is as follows:
<table> <table>
<thead>
<tr> <tr>
<th>Option</th> <th>Option</th>
<th>Meaning</th> <th>Meaning</th>
</tr> </tr>
</thead>
<tbody>
<tr> <tr>
<td><code>'<'</code></td> <td><code>'<'</code></td>
<td> <td>
@ -117,7 +117,6 @@ The meaning of the various alignment options is as follows:
<td><code>'^'</code></td> <td><code>'^'</code></td>
<td>Forces the field to be centered within the available space.</td> <td>Forces the field to be centered within the available space.</td>
</tr> </tr>
</tbody>
</table> </table>
Note that unless a minimum field width is defined, the field width will Note that unless a minimum field width is defined, the field width will
@ -127,11 +126,29 @@ option has no meaning in this case.
The *sign* option is only valid for floating point and signed integer The *sign* option is only valid for floating point and signed integer
types, and can be one of the following: types, and can be one of the following:
| Option | Meaning | <table>
|--------|-------------------------------------------------------------------------------------------------------------| <tr>
| `'+'` | indicates that a sign should be used for both nonnegative as well as negative numbers. | <th>Option</th>
| `'-'` | indicates that a sign should be used only for negative numbers (this is the default behavior). | <th>Meaning</th>
| space | indicates that a leading space should be used on nonnegative numbers, and a minus sign on negative numbers. | </tr>
<tr>
<td><code>'+'</code></td>
<td>
Indicates that a sign should be used for both nonnegative as well as
negative numbers.
</td>
<td><code>'-'</code></td>
<td>
Indicates that a sign should be used only for negative numbers (this is the
default behavior).
</td>
<td>space</td>
<td>
Indicates that a leading space should be used on nonnegative numbers, and a
minus sign on negative numbers.
</td>
</tr>
</table>
The `'#'` option causes the "alternate form" to be used for the The `'#'` option causes the "alternate form" to be used for the
conversion. The alternate form is defined differently for different conversion. The alternate form is defined differently for different
@ -191,16 +208,58 @@ The available character presentation types are:
The available integer presentation types are: The available integer presentation types are:
| Type | Meaning | <table>
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| <tr>
| `'b'` | Binary format. Outputs the number in base 2. Using the `'#'` option with this type adds the prefix `"0b"` to the output value. | <th>Type</th>
| `'B'` | Binary format. Outputs the number in base 2. Using the `'#'` option with this type adds the prefix `"0B"` to the output value. | <th>Meaning</th>
| `'c'` | Character format. Outputs the number as a character. | </tr>
| `'d'` | Decimal integer. Outputs the number in base 10. | <tr>
| `'o'` | Octal format. Outputs the number in base 8. | <td><code>'b'</code></td>
| `'x'` | Hex format. Outputs the number in base 16, using lower-case letters for the digits above 9. Using the `'#'` option with this type adds the prefix `"0x"` to the output value. | <td>
| `'X'` | Hex format. Outputs the number in base 16, using upper-case letters for the digits above 9. Using the `'#'` option with this type adds the prefix `"0X"` to the output value. | Binary format. Outputs the number in base 2. Using the <code>'#'</code>
| none | The same as `'d'`. | option with this type adds the prefix <code>"0b"</code> to the output value.
</td>
</tr>
<tr>
<td><code>'B'</code></td>
<td>
Binary format. Outputs the number in base 2. Using the <code>'#'</code>
option with this type adds the prefix <code>"0B"</code> to the output value.
</td>
</tr>
<tr>
<td><code>'c'</code></td>
<td>Character format. Outputs the number as a character.</td>
</tr>
<tr>
<td><code>'d'</code></td>
<td>Decimal integer. Outputs the number in base 10.</td>
</tr>
<tr>
<td><code>'o'</code></td>
<td>Octal format. Outputs the number in base 8.</td>
</tr>
<tr>
<td><code>'x'</code></td>
<td>
Hex format. Outputs the number in base 16, using lower-case letters for the
digits above 9. Using the <code>'#'</code> option with this type adds the
prefix <code>"0x"</code> to the output value.
</td>
</tr>
<tr>
<td><code>'X'</code></td>
<td>
Hex format. Outputs the number in base 16, using upper-case letters for the
digits above 9. Using the <code>'#'</code> option with this type adds the
prefix <code>"0X"</code> to the output value.
</td>
</tr>
<tr>
<td>none</td>
<td>The same as <code>'d'</code>.</td>
</tr>
</table>
Integer presentation types can also be used with character and Boolean values Integer presentation types can also be used with character and Boolean values
with the only exception that `'c'` cannot be used with `bool`. Boolean values with the only exception that `'c'` cannot be used with `bool`. Boolean values
@ -209,69 +268,77 @@ presentation type is not specified.
The available presentation types for floating-point values are: The available presentation types for floating-point values are:
<table style="width:96%;"> <table>
<colgroup> <tr>
<col style="width: 13%" /> <th>Type</th>
<col style="width: 81%" /> <th>Meaning</th>
</colgroup>
<thead>
<tr class="header">
<th>Type</th>
<th>Meaning</th>
</tr> </tr>
</thead> <tr>
<tbody> <td><code>'a'</code></td>
<tr class="odd"> <td>
<td><code>'a'</code></td> Hexadecimal floating point format. Prints the number in base 16 with
<td>Hexadecimal floating point format. Prints the number in base 16 with prefix <code>"0x"</code> and lower-case letters for digits above 9.
prefix <code>"0x"</code> and lower-case letters for digits above 9. Uses Uses <code>'p'</code> to indicate the exponent.
<code>'p'</code> to indicate the exponent.</td> </td>
</tr> </tr>
<tr class="even"> <tr>
<td><code>'A'</code></td> <td><code>'A'</code></td>
<td>Same as <code>'a'</code> except it uses upper-case letters for the <td>
prefix, digits above 9 and to indicate the exponent.</td> Same as <code>'a'</code> except it uses upper-case letters for the
prefix, digits above 9 and to indicate the exponent.
</td>
</tr> </tr>
<tr class="odd"> <tr>
<td><code>'e'</code></td> <td><code>'e'</code></td>
<td>Exponent notation. Prints the number in scientific notation using <td>
the letter 'e' to indicate the exponent.</td> Exponent notation. Prints the number in scientific notation using
the letter 'e' to indicate the exponent.
</td>
</tr> </tr>
<tr class="even"> <tr>
<td><code>'E'</code></td> <td><code>'E'</code></td>
<td>Exponent notation. Same as <code>'e'</code> except it uses an <td>
upper-case <code>'E'</code> as the separator character.</td> Exponent notation. Same as <code>'e'</code> except it uses an
upper-case <code>'E'</code> as the separator character.
</td>
</tr> </tr>
<tr class="odd"> <tr>
<td><code>'f'</code></td> <td><code>'f'</code></td>
<td>Fixed point. Displays the number as a fixed-point number.</td> <td>Fixed point. Displays the number as a fixed-point number.</td>
</tr> </tr>
<tr class="even"> <tr>
<td><code>'F'</code></td> <td><code>'F'</code></td>
<td>Fixed point. Same as <code>'f'</code>, but converts <code>nan</code> <td>
to <code>NAN</code> and <code>inf</code> to <code>INF</code>.</td> Fixed point. Same as <code>'f'</code>, but converts <code>nan</code>
to <code>NAN</code> and <code>inf</code> to <code>INF</code>.
</td>
</tr> </tr>
<tr class="odd"> <tr>
<td><code>'g'</code></td> <td><code>'g'</code></td>
<td><p>General format. For a given precision <code>p &gt;= 1</code>, <td>
this rounds the number to <code>p</code> significant digits and then <p>General format. For a given precision <code>p &gt;= 1</code>,
formats the result in either fixed-point format or in scientific this rounds the number to <code>p</code> significant digits and then
notation, depending on its magnitude.</p> formats the result in either fixed-point format or in scientific
<p>A precision of <code>0</code> is treated as equivalent to a precision notation, depending on its magnitude.</p>
of <code>1</code>.</p></td> <p>A precision of <code>0</code> is treated as equivalent to a precision
of <code>1</code>.</p>
</td>
</tr> </tr>
<tr class="even"> <tr>
<td><code>'G'</code></td> <td><code>'G'</code></td>
<td>General format. Same as <code>'g'</code> except switches to <td>
<code>'E'</code> if the number gets too large. The representations of General format. Same as <code>'g'</code> except switches to
infinity and NaN are uppercased, too.</td> <code>'E'</code> if the number gets too large. The representations of
infinity and NaN are uppercased, too.
</td>
</tr> </tr>
<tr class="odd"> <tr>
<td>none</td> <td>none</td>
<td>Similar to <code>'g'</code>, except that the default precision is as <td>
high as needed to represent the particular value.</td> Similar to <code>'g'</code>, except that the default precision is as
high as needed to represent the particular value.
</td>
</tr> </tr>
</tbody>
</table> </table>
The available presentation types for pointers are: The available presentation types for pointers are:
@ -288,7 +355,9 @@ as `std::tm` have the following syntax:
<a id="chrono-format-spec"></a> <a id="chrono-format-spec"></a>
<pre> <pre>
chrono_format_spec ::= [[<a href="#format-spec">fill</a>]<a href="#format-spec">align</a>][<a href="#format-spec">width</a>]["." <a href="#format-spec">precision</a>][chrono_specs] chrono_format_spec ::= [[<a href="#format-spec">fill</a>]<a href="#format-spec"
>align</a>][<a href="#format-spec">width</a>]["." <a href="#format-spec"
>precision</a>][chrono_specs]
chrono_specs ::= [chrono_specs] conversion_spec | chrono_specs literal_char chrono_specs ::= [chrono_specs] conversion_spec | chrono_specs literal_char
conversion_spec ::= "%" [padding_modifier] [locale_modifier] chrono_type conversion_spec ::= "%" [padding_modifier] [locale_modifier] chrono_type
literal_char ::= &lt;a character other than '{', '}' or '%'> literal_char ::= &lt;a character other than '{', '}' or '%'>
@ -359,8 +428,8 @@ The available padding modifiers (*padding_modifier*) are:
| `'_'` | Do not pad a numeric result string. | | `'_'` | Do not pad a numeric result string. |
| `'0'` | Pad a numeric result string with zeros. | | `'0'` | Pad a numeric result string with zeros. |
Currently, these modifiers are only supported for the ``'H', 'I', 'M', 'S', 'U', 'V'`` Currently, these modifiers are only supported for the `'H'`, `'I'`, `'M'`,
and ``'W'`` presentation types. `'S'`, `'U'`, `'V'` and `'W'` presentation types.
## Range Format Specifications ## Range Format Specifications