[Python-ideas] locale-independent number formatting (was: Rough draft: Proposed format specifier for a thousands separator)
eric at trueblade.com
Fri Mar 13 01:02:20 CET 2009
Bruce Frederiksen wrote:
> Eric Smith wrote:
>> >>> format_number(whole_part='123456787654321',
>> grouping=[4, 3, 2])
>> >>> '18.104.22.168.765.4321'
> Maybe the 'thousands_sep' parameter should be called 'grouping_sep'
> (since it doesn't always group by thousands)?
> -bruce frederiksen
thousands_sep is the locale.localeconv() name, which I suggest we use.
I suggest that this particular API only support the LC_NUMERIC fields
(decimal_point, grouping, thousands_sep), and that maybe we have a
separate format_money which supports the LC_MONETARY fields.
More information about the Python-ideas