mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #25179: Preparatory cleanup of existing docs on string formatting
* Various sections were pointing to the section on the string.Formatter class, when the section on the common format string syntax is probably more appropriate * Fix references to various format() functions and methods * Nested replacement fields may contain conversions and format specifiers, and this is tested; see Issue #19729 for instance
This commit is contained in:
parent
b6213c5664
commit
d5db14794b
9 changed files with 31 additions and 29 deletions
|
@ -839,7 +839,7 @@ How do I convert a number to a string?
|
|||
To convert, e.g., the number 144 to the string '144', use the built-in type
|
||||
constructor :func:`str`. If you want a hexadecimal or octal representation, use
|
||||
the built-in functions :func:`hex` or :func:`oct`. For fancy formatting, see
|
||||
the :ref:`string-formatting` section, e.g. ``"{:04d}".format(144)`` yields
|
||||
the :ref:`formatstrings` section, e.g. ``"{:04d}".format(144)`` yields
|
||||
``'0144'`` and ``"{:.3f}".format(1.0/3.0)`` yields ``'0.333'``.
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue