mirror of https://github.com/python/cpython
Issue #11304: Input/output tutorial - PI is rounded not truncated.
This commit is contained in:
parent
e457f0d220
commit
c38f025a55
|
@ -163,7 +163,7 @@ Positional and keyword arguments can be arbitrarily combined::
|
||||||
|
|
||||||
An optional ``':'`` and format specifier can follow the field name. This allows
|
An optional ``':'`` and format specifier can follow the field name. This allows
|
||||||
greater control over how the value is formatted. The following example
|
greater control over how the value is formatted. The following example
|
||||||
truncates Pi to three places after the decimal.
|
rounds Pi to three places after the decimal.
|
||||||
|
|
||||||
>>> import math
|
>>> import math
|
||||||
>>> print('The value of PI is approximately {0:.3f}.'.format(math.pi))
|
>>> print('The value of PI is approximately {0:.3f}.'.format(math.pi))
|
||||||
|
|
Loading…
Reference in New Issue