Rough draft: Proposed format specifier for a thousands separator

Scott David Daniels Scott.Daniels at Acm.Org
Thu Mar 12 14:38:22 EDT 2009


Raymond Hettinger wrote:
<... a generally interesting PEP...>

Missing from this PEP:
  output below the decimal point.

show results for something like:
   format(12345.54321, "15,.5f") --> '  12,345.543,21'

Explain the interaction on sizes and lengths (which numbers are digits,
which are length [I vote for length on overall, digits on precision]),
and what happens with length-4 -- I'd say explicitly 1000 is show as
"1,000" despite style sheets that prefer "1000" and "10,000".

FWIW, I agree with pruebano, do the simplest easily usable thing, and
provide a way to swap  the commas and periods.  The rest can be ponied
in by string processing.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list