[issue2526] str.format() :n format does not appear to work

Mark Summerfield report at bugs.python.org
Tue Apr 1 13:35:26 CEST 2008


New submission from Mark Summerfield <mark at qtrac.eu>:

>>> # Py30a3
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "en_US.UTF8")
'en_US.UTF8'
>>> locale.format("%d", 12345, True)
'12,345'
>>> "{0:n}".format(12345)
'12345'

According to the docs the 'n' format should use the locale-dependent
separator, so I expected both strings to be '12,345'.

Also, it is a pity that locale.format() uses the old deprecated % syntax
rather than the much nicer and better str.format() syntax.

----------
components: Interpreter Core
messages: 64804
nosy: mark
severity: normal
status: open
title: str.format() :n format does not appear to work
type: behavior
versions: Python 3.0

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2526>
__________________________________


More information about the Python-bugs-list mailing list