Eric V. Smith added the comment:

Just to clarify:

If not specified, the default "presentation type" for floats is "g". Since you 
didn't specify "f" in your example, it's using "g". For presentation type "g", 
the precision (3 in your case) is the total number of significant digits. So 
12.34 first becomes 12.3, then that's displayed in a field 8 characters wide, 
which gives you the 4 leading zeros.

See the section of presentation types for floating point at the end of this 
section:
https://docs.python.org/2/library/string.html#format-specification-mini-language

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24281>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to