Rough draft: Proposed format specifier for a thousands separator
Raymond Hettinger
python at rcn.com
Fri Mar 13 07:15:51 EDT 2009
[andrew cooke]
> would it break anything to also allow
>
> >>> format(1234567, 'd') # what we have now
> '1234567'
> >>> format(1234567, '.d') # proposed new option
> '1.234.567'
> >>> format(1234.5, ',2f') # proposed new option
> '1234,50'
> >>> format(1234.5, '.,2f') # proposed new option
Yes, that's allowed too! The separators can be any one of COMMA,
SPACE, DOT, UNDERSCORE, or NON-BREAKING-SPACE.
More information about the Python-list
mailing list