← Back to DAGDA | Support | Source: https://bugs.python.org/issue25480

➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: string format in large number
Type: behavior Stage: resolved
Components: Versions: Python 3.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, tryme
Priority: normal Keywords:

Created on 2015-10-26 08:14 by tryme, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg253459 - (view) Author: tryme (tryme) Date: 2015-10-26 08:14
I am new to python and I don't know if it really is a bug. But indeed when I see sth is not right it is worthwhile to point out.

Using fresh installed ubuntu desktop with build in python3.
typing the command line by line in terminal just for learning. below is the scene
it has automatically round down. Don't know if it is limit of float.


$ python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> "hello{0:5.2f}".format(100000000000000.234)
'hello100000000000000.23'
>>> "hello{0:5.2f}".format(4111111111111111117.234)
'hello4111111111111111168.00'
>>> "hello{0:5.2f}".format(1000000000000000000.234)
'hello1000000000000000000.00'
msg253460 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2015-10-26 08:33
You should read: https://docs.python.org/3/tutorial/floatingpoint.html
History
Date User Action Args
2022-04-11 14:58:23adminsetgithub: 69666
2015-10-26 08:33:13eric.smithsetstatus: open -> closed

components: - Build

nosy: + eric.smith
messages: + msg253460
resolution: not a bug
stage: resolved
2015-10-26 08:14:22trymecreate