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: defined format returns error
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, ted7234889
Priority: normal Keywords:

Created on 2007-06-22 13:56 by ted7234889, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Lumen_6.py ted7234889, 2007-06-22 13:56 A lighting calc wich is a work in progress i should output as #.##
Messages (2)
msg32380 - (view) Author: Ted Bell (ted7234889) Date: 2007-06-22 13:56
print round(i[,2])
This returned the error invalid syntex but this round( x[, n]) is out it is shown the reference library under 2.1 Built in functions. I have tried leaving out the comma as well asvarious other combinations to no avail, can someone help please, I need to round a number to two decimal places before outputting to the user.

Ted
msg32381 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-06-22 14:05
The square brackets indicate an optional argument:

print round(i)
print round(i, 2)

are both valid calls of round().
History
Date User Action Args
2022-04-11 14:56:25adminsetgithub: 45121
2007-06-22 13:56:06ted7234889create