[docs] [issue24281] String formatting: incorrect number of decimal places

James Luscher report at bugs.python.org
Mon May 25 05:47:41 CEST 2015


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 (default, Mar 26 2015, 22:03:40) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> '{:08.3}'.format(12.34)
'000012.3'

When what I am expecting is:  '0012.340'

----------
assignee: docs at python
components: Documentation
messages: 244011
nosy: docs at python, jluscher
priority: normal
severity: normal
status: open
title: String formatting: incorrect number of decimal places
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24281>
_______________________________________


More information about the docs mailing list