[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 00:02:52 CET 2009


> I also have to say that I find Eric's proposal a bit ambiguous: why
> shouldn't {:8,d} mean "insert commas between thousands"?

It does.  That is the sixth example listed:

  format(1234, "8.1f")     -->    '  1234.0'
  format(1234, "8,1f")     -->    '  1234,0'
  format(1234, "8.,1f")    -->    ' 1.234,0'
  format(1234, "8 ,f")     -->    ' 1 234,0'
  format(1234, "8d")       -->    '    1234'
  format(1234, "8,d")      -->    '   1,234'
  format(1234, "8_d")      -->    '   1_234'



Raymond



More information about the Python-ideas mailing list