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

Raymond Hettinger python at rcn.com
Wed Mar 18 13:44:53 CET 2009


>> What I've generally seen on cheques is $****1,000.00
> 
> Interestingly, str.format will actually be able to produce directly in 3.1:
> 
>  "${:*>,.2f}".format(value)

What we have already in SVN courtesy of Mark Dickinson:

>>> from decimal import Decimal
>>> value = Decimal(1000)
>>> "${:*>12,.2f}".format(value)
'$****1,000.00'



Raymond



More information about the Python-ideas mailing list