[docs] [issue35126] Mistake in FAQ about converting number to string.

Pawel report at bugs.python.org
Wed Oct 31 13:07:39 EDT 2018


New submission from Pawel <grottrumsel at gmail.com>:

In this question:
https://docs.python.org/2.7/faq/programming.html#how-do-i-convert-a-number-to-a-string

There is a statement:
"{:.3f}".format(1/3) yields '0.333'

While

In [2]: "{:.3f}".format(1/3)
Out[2]: '0.000'

In [3]: "{:.3f}".format(1/3.0)
Out[3]: '0.333'

----------
assignee: docs at python
components: Documentation
messages: 329000
nosy: docs at python, grottrumsel
priority: normal
severity: normal
status: open
title: Mistake in FAQ about converting number to string.
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35126>
_______________________________________


More information about the docs mailing list