[issue5782] ',' formatting with empty format type '' (PEP 378)

Mark Dickinson report at bugs.python.org
Fri Apr 17 20:33:16 CEST 2009


Mark Dickinson <dickinsm at gmail.com> added the comment:

Sounds good to me, too.

It looks as though the Decimal type already does this:

Python 3.1a2+ (py3k:71669:71684M, Apr 17 2009, 19:23:53) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from decimal import Decimal
>>> format(Decimal('1.2'), '010.2')
'00000001.2'
>>> format(Decimal('1.2'), '010,.2')
'0,000,001.2'

----------

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


More information about the Python-bugs-list mailing list