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: format
Type: behavior Stage: resolved
Components: Versions: Python 3.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Daniel_Python, eric.smith
Priority: normal Keywords:

Created on 2019-09-04 11:05 by Daniel_Python, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg351119 - (view) Author: Daniel Futterweit (Daniel_Python) Date: 2019-09-04 11:06
f'{10000000000000001323120000000000001:,.0f}'
returns:
'10,000,000,000,000,001,761,595,319,084,122,112'

f'{10000000000000001323120000000000001:,}'
returns:
'10,000,000,000,000,001,323,120,000,000,000,001'
msg351120 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2019-09-04 11:12
When you convert the integer to a float (because of the 'f' in the first format spec), you're losing precision. See:

https://docs.python.org/3/tutorial/floatingpoint.html and https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate
History
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82206
2019-09-04 11:12:33eric.smithsetstatus: open -> closed

nosy: + eric.smith
messages: + msg351120

resolution: not a bug
stage: resolved
2019-09-04 11:06:46Daniel_Pythonsetmessages: + msg351119
2019-09-04 11:05:51Daniel_Pythoncreate