[New-bugs-announce] [issue3140] str.format("{0:n}") poss. bug with setlocale()

Mark Summerfield report at bugs.python.org
Thu Jun 19 15:02:13 CEST 2008


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

Python 30b1

>>> import locale
>>> locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
'en_US.UTF-8'
>>> for x in
(1234,12345,123456,1234567,12345678,123456789,1234567890,12345678900):
	print("[{0:>20n}]".format(x))

	
[                1,234]
[               12,345]
[              123,456]
[             1,234,567]
[            12,345,678]
[           123,456,789]
[          1,234,567,890]
[         12,345,678,900]

I expected that the commas would not increase the width, but maybe this
was the intended behaviour?

----------
messages: 68403
nosy: mark
severity: normal
status: open
title: str.format("{0:n}") poss. bug with setlocale()
type: behavior
versions: Python 3.0

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


More information about the New-bugs-announce mailing list