mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #11304: Input/output tutorial - PI is rounded not truncated.
This commit is contained in:
parent
f4d2b3dc10
commit
2bd4795e94
1 changed files with 1 additions and 1 deletions
|
@ -160,7 +160,7 @@ convert the value before it is formatted. ::
|
|||
|
||||
An optional ``':'`` and format specifier can follow the field name. This allows
|
||||
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
|
||||
>>> print 'The value of PI is approximately {0:.3f}.'.format(math.pi)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue