[issue24281] String formatting: incorrect number of decimal places

2015-05-26 Thread James Luscher
James Luscher added the comment: Eric, I am not familiar with the 'g' format and did not know it was the default, but the documentation, read fully, is correct. It just took the response of Christopher Welborn to "wake me up" (it was a LONG day and I was "struggling" to understand the problem

[issue24281] String formatting: incorrect number of decimal places

2015-05-26 Thread Eric V. Smith
Eric V. Smith added the comment: And I just double checked: the entirety of the sentence you quoted is: The precision is a decimal number indicating how many digits should be displayed after the decimal point for a floating point value formatted with 'f' and 'F', or before and after the decima

[issue24281] String formatting: incorrect number of decimal places

2015-05-25 Thread Eric V. Smith
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 fi

[issue24281] String formatting: incorrect number of decimal places

2015-05-24 Thread R. David Murray
Changes by R. David Murray : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python

[issue24281] String formatting: incorrect number of decimal places

2015-05-24 Thread Christopher Welborn
Christopher Welborn added the comment: You forgot the 'f' to specify that you want float formatting: ``` >>> '{:08.3f}'.format(12.34) '0012.340' ``` -- nosy: +cjwelborn ___ Python tracker ___

[issue24281] String formatting: incorrect number of decimal places

2015-05-24 Thread Larry Hastings
Changes by Larry Hastings : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue24281] String formatting: incorrect number of decimal places

2015-05-24 Thread James Luscher
New submission from James Luscher: Doc for 3.4: at 6.1.3.1. Format Specification Mini-Language indicates that: "The precision is a decimal number indicating how many digits should be displayed after the decimal point for a floating point value" Yet I find that I get this behavior: Python 3.4.3