mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-04 17:26:42 +00:00
Use parsed literal block for the grammar. Document 0 flag.
This commit is contained in:
parent
363352754c
commit
4dea3200a9
20
README.rst
20
README.rst
@ -79,14 +79,20 @@ braces ``{}``. Text outside of braces is copied unchanged to the output.
|
|||||||
If you need to include a brace character in the literal text, it can be
|
If you need to include a brace character in the literal text, it can be
|
||||||
escaped by doubling: ``{{`` and ``}}``.
|
escaped by doubling: ``{{`` and ``}}``.
|
||||||
|
|
||||||
The grammar for a replacement field is as follows::
|
The grammar for a replacement field is as follows:
|
||||||
|
|
||||||
replacement_field: "{" arg_index [":" format_spec] "}"
|
.. parsed-literal::
|
||||||
arg_index: integer
|
|
||||||
format_spec: ["+"]["0"][width]["." precision][type]
|
_`replacement_field`: "{" `arg_index`_ [":" `format_spec`_] "}"
|
||||||
width: integer
|
_`arg_index`: integer
|
||||||
precision: integer
|
_`format_spec`: ["+"]["0"][`width`_]["." `precision`_][`type`_]
|
||||||
type: "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "o" | "p" | "s" | "x" | "X"
|
_`width`: integer
|
||||||
|
_`precision`: integer | "{" `arg_index`_ "}"
|
||||||
|
_`type`: "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "o" | "p" | "s" | "x" | "X"
|
||||||
|
|
||||||
|
Preceding the `width`_ field with ``0`` makes the padding to be placed
|
||||||
|
after the sign (if any) but before the digits. This is used for printing
|
||||||
|
fields in the form ``+000000120``. This option is only valid for numeric types.
|
||||||
|
|
||||||
Motivation
|
Motivation
|
||||||
----------
|
----------
|
||||||
|
Loading…
Reference in New Issue
Block a user