aboutsummaryrefslogtreecommitdiff
path: root/thirdparty/fmt/doc/syntax.md
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/fmt/doc/syntax.md')
-rw-r--r--thirdparty/fmt/doc/syntax.md10
1 files changed, 6 insertions, 4 deletions
diff --git a/thirdparty/fmt/doc/syntax.md b/thirdparty/fmt/doc/syntax.md
index 46d7d2fd2..ac5128233 100644
--- a/thirdparty/fmt/doc/syntax.md
+++ b/thirdparty/fmt/doc/syntax.md
@@ -251,7 +251,7 @@ The available integer presentation types are:
<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.
+ option with this type adds the prefix <code>"0b"</code> to the output value.
</td>
</tr>
<tr>
@@ -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:
<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>
The `'n'` option formats the range without the opening and closing brackets.
@@ -761,14 +761,16 @@ fmt::print("{::}", std::vector{'h', 'e', 'l', 'l', 'o'});
// Output: [h, e, l, l, o]
fmt::print("{::d}", std::vector{'h', 'e', 'l', 'l', 'o'});
// 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
This section contains examples of the format syntax and comparison with
-the printf formatting.
+the `printf` formatting.
-In most of the cases the syntax is similar to the printf formatting,
+In most of the cases the syntax is similar to the `printf` formatting,
with the addition of the `{}` and with `:` used instead of `%`. For
example, `"%03.2f"` can be translated to `"{:03.2f}"`.