[New-bugs-announce] [issue17259] locale.format() rounding is not reliable for floats

Francis Nimick report at bugs.python.org
Wed Feb 20 22:21:54 CET 2013


New submission from Francis Nimick:

Locale.format() doesn't work correctly with floating point numbers.

locale.format('%.0f', 5.5) -> 6
locale.format('%.0f', 6.5) -> 6
locale.format('%.0f', 7.5) -> 8
locale.format('%.0f', 8.5) -> 8

It seems that if the number before the decimal point is even, it rounds down, else it rounds up.

----------
components: Library (Lib)
messages: 182554
nosy: Francis.Nimick
priority: normal
severity: normal
status: open
title: locale.format() rounding is not reliable for floats
type: behavior
versions: Python 2.7

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


More information about the New-bugs-announce mailing list