Skip to content

[3.9] Corrections to format precision description. (GH-31291) #31321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Doc/library/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,13 @@ When no explicit alignment is given, preceding the *width* field by a zero
sign-aware zero-padding for numeric types. This is equivalent to a *fill*
character of ``'0'`` with an *alignment* type of ``'='``.

The *precision* is a decimal number indicating how many digits should be
displayed after the decimal point for a floating point value formatted with
``'f'`` and ``'F'``, or before and after the decimal point for a floating point
value formatted with ``'g'`` or ``'G'``. For non-number types the field
The *precision* is a decimal integer indicating how many digits should be
displayed after the decimal point for presentation types
``'f'`` and ``'F'``, or before and after the decimal point for presentation
types ``'g'`` or ``'G'``. For string presentation types the field
indicates the maximum field size - in other words, how many characters will be
used from the field content. The *precision* is not allowed for integer values.
used from the field content. The *precision* is not allowed for integer
presentation types.

Finally, the *type* determines how the data should be presented.

Expand Down