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

Antoine Pitrou solipsis at pitrou.net
Fri Mar 13 11:02:22 CET 2009

Greg Ewing <greg.ewing at ...> writes:
> My point is that while it's perfectly reasonable
> for, e.g. a French programmer to want to format his
> numbers with dots and commas the other way around,
> it's *not* reasonable to force him to tediously specify
> it in each and every format specifier he writes.

A program often formatting numbers the same way can factor that into dedicated

    def format_float(f):
        return "{0:T.,2f}".format(f)

or even:

    format_float = "{0:T.,2f}".format



More information about the Python-ideas mailing list