[New-bugs-announce] [issue16944] German number separators not working using format language and locale "de_DE"

Peter Stahl report at bugs.python.org
Sat Jan 12 12:26:56 CET 2013


New submission from Peter Stahl:

Yesterday, I opened a question on Stackoverflow that explains my problem in detail. Please read this page first:

http://stackoverflow.com/questions/14287051/german-number-separators-using-format-language-on-osx

A short summary: I'm on OSX 10.8.2. I wanted to format numbers according to the German numbering convention using Python's format language and the locale setting "de_DE". Actually, the following should work to achieve that:

>>> import locale
>>> locale.setlocale(locale.LC_ALL, 'de_DE')
>>> '{0:n}'.format(1234.56)

The result of the last expressions should be 1.234,56. However, my result is 1234,56. More examples are on Stackoverflow.

According to what other SO members have found out, this is a problem with the locale settings of OSX because the grouping of numbers is not fully part of the locale "de_DE". On Windows, however, grouping works fine using the locale "deu_deu" which is not available on OSX.

Is this a bug? At least, it doesn't seem to be documented anywhere and is probably not the correct behavior even on OSX. Others have reported similar problems on OSX as well.

Do you have a quick solution for this issue? Thanks in advance.

----------
components: Library (Lib)
messages: 179785
nosy: Peter.Stahl
priority: normal
severity: normal
status: open
title: German number separators not working using format language and locale "de_DE"
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16944>
_______________________________________


More information about the New-bugs-announce mailing list