mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-24 11:20:11 +01:00
docs: range formatter grammar fix (#4567)
This commit is contained in:
@@ -718,7 +718,7 @@ These modifiers are only supported for the `'H'`, `'I'`, `'M'`, `'S'`, `'U'`,
|
|||||||
Format specifications for range types have the following syntax:
|
Format specifications for range types have the following syntax:
|
||||||
|
|
||||||
<pre><code class="language-json"
|
<pre><code class="language-json"
|
||||||
>range_format_spec ::= ["n"][range_type][range_underlying_spec]</code>
|
>range_format_spec ::= ["n"][range_type][":" range_underlying_spec]</code>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
The `'n'` option formats the range without the opening and closing brackets.
|
The `'n'` option formats the range without the opening and closing brackets.
|
||||||
@@ -761,6 +761,8 @@ fmt::print("{::}", std::vector{'h', 'e', 'l', 'l', 'o'});
|
|||||||
// Output: [h, e, l, l, o]
|
// Output: [h, e, l, l, o]
|
||||||
fmt::print("{::d}", std::vector{'h', 'e', 'l', 'l', 'o'});
|
fmt::print("{::d}", std::vector{'h', 'e', 'l', 'l', 'o'});
|
||||||
// Output: [104, 101, 108, 108, 111]
|
// Output: [104, 101, 108, 108, 111]
|
||||||
|
fmt::print("{:n:f}", std::array{std::numbers::pi, std::numbers::e});
|
||||||
|
// Output: 3.141593, 2.718282
|
||||||
```
|
```
|
||||||
|
|
||||||
## Format Examples
|
## Format Examples
|
||||||
|
|||||||
Reference in New Issue
Block a user