[Python-ideas] Rough draft: Proposed format specifier for a thousands separator (discussion moved from python-dev)
Mark Dickinson
dickinsm at gmail.com
Tue Mar 17 14:18:42 CET 2009
On Tue, Mar 17, 2009 at 11:04 AM, Greg Ewing
<greg.ewing at canterbury.ac.nz> wrote:
> [...] as it looks decidedly weird, but if I had
> to pick a meaning for format(1234, "08,d") I think
> I would make it
>
> ' 001,234'
Yes, that looks better than either of the alternatives I gave.
I think I prefer that commas *do* appear in the zero padding, though
as Eric says, it does add some extra complication to the code. In
the case of the decimal code that complication is significant, mainly
because of the need to figure out how much space is available
for the zeros *before* doing the comma insertion.
Mark
More information about the Python-ideas
mailing list