[Python-ideas] Rough draft: Proposed format specifier for a thousands separator (discussion moved from python-dev)

Raymond Hettinger python at rcn.com
Tue Mar 17 22:00:15 CET 2009


[Guido van Rossum]
>> I agree that the given width should include the
>> commas, but I strongly feel that leading zeros should be comma-fied
>> just like everything else.

+1

[Greg Ewing]
> I think we need some use cases before a proper
> decision can be made about this. If you were using
> comma-separated zero-filled numbers, what would
> your objective be, and what choice would best
> fulfill it?

I gave one example of writing out numbers in columns
and that makes it clear that putting commas in the
leading zeros is the right thing to do (anything else
looks unusably weird).

Also, as Guido pointed-out, anyone specifying zero-padding
is saying that they intend to not be showing spaces where
digits would go.  Our choice ought to respect that intention.


Raymond



More information about the Python-ideas mailing list