Message170802
> I can't reproduce this with Python 2.7.3.
> >>> locale.setlocale(locale.LC_NUMERIC, 'fr_FR')
> 'fr_FR'
> >>> u'{:n}'.format(10000)
> u'10 000'
I don't understand why, but the all french locales are the same. Some "french locale" uses the standard ASCII space (U+0020) as thousand seperator, others use the non-breaking space (U+00A0). I suppose that some systems prefer to avoid non-ASCII characters to avoid "Unicode issues".
On Ubuntu 12.04, locale.localeconv()['thousands_sep'] is chr(32) for the locale fr_FR.utf8.
You may need to install other locales to test this issue. For example, the ps_AF locale uses U+066b as the decimal point and the thousands separator.
I chose to not fix the issue in Python 3.2 because it needs to change too much code (and I don't want to introduce a regression and 3.2 code is very different than 3.3). You should upgrade to Python 3.3, or reimplement the Unicode format() function for numbers using locale.localeconv() ('thousands_sep', 'decimal_point' and 'grouping') :-/
Or find a more motivated developer. Or I can do the job if you pay me ;-)
(Read also the issue #13706 for more information.) |
|
Date |
User |
Action |
Args |
2012-09-20 12:03:49 | vstinner | set | recipients:
+ vstinner, loewis, eric.smith, ezio.melotti, Arfrever, chris.jerdonek, berker.peksag, serhiy.storchaka, Ariel.Ben-Yehuda |
2012-09-20 12:03:49 | vstinner | set | messageid: <1348142629.01.0.828345024438.issue15276@psf.upfronthosting.co.za> |
2012-09-20 12:03:48 | vstinner | link | issue15276 messages |
2012-09-20 12:03:47 | vstinner | create | |
|