Skip to content
Open
Changes from 4 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
4 changes: 3 additions & 1 deletion Doc/library/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ If not specified, then the field width will be determined by the content.
When no explicit alignment is given, preceding the *width* field by a zero
(``'0'``) character enables sign-aware zero-padding for numeric types,
excluding :class:`complex`. This is equivalent to a *fill* character of
``'0'`` with an *alignment* type of ``'='``.
``'0'`` with an *alignment* type of ``'='``. If digit group separators of the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit surprised that "digit group separator" is mentioned here while we only mention it in the "grouping option" paragraph below. Maybe we should mention it at that place or mention here that this will be introduced below?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the different parts of the format are interconnected, there may be references to options described in details below.

But I think that we should unify wording and avoid repetition of what specifies the grouping option. "If the grouping option for the integral part is used, a digit group separator is also inserted between leading zeros."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@serhiy-storchaka, I think that remark was addressed. Is there anything left?

integral part of a number are used (as specified either by ``','`` or ``'_'``
option), they are also placed between leading zeros.

.. versionchanged:: 3.10
Preceding the *width* field by ``'0'`` no longer affects the default
Expand Down
Loading