[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 16:12:20 CET 2009


On Tue, Mar 17, 2009 at 2:58 PM, Eric Smith <eric at trueblade.com> wrote:
> And what happens when the comma would be the first character?
>
> ,012,345
> 0012,345
>
> or something else?

Options are:

(A) ",012,345"
(B) "0012,345"
(C) " 012,345"
(D) "0,012,345"
(E) write-in option here

I vote for (D):  it's one character too large, but the given precision
is only supposed to be a minimum anyway.  We already end up
with a length-9 string when formatting 1234567.

(D) is the minimum width string that:
  doesn't look weird (like (A) and (B)),
  has length at least 8, and
  is still in the right basic format

(C) would be my second choice, but I find the extra space padding
to be somewhat arbitrary (why a space? why not some other
padding character?)

Mark



More information about the Python-ideas mailing list