[New-bugs-announce] [issue22090] Decimal and float formatting treat '%' differently for infinities and nans.

Mark Dickinson report at bugs.python.org
Sun Jul 27 12:08:43 CEST 2014


New submission from Mark Dickinson:

There's a minor inconsistency between Decimal and float formatting for the `%` format type when handling infinities and nans:

>>> from decimal import Decimal
>>> format(float('inf'), '.2%')  # includes trailing '%'
'inf%'
>>> format(Decimal('inf'), '.2%')  # no trailing '%'
'Infinity'

I think the Decimal result should have a '%' on it.

----------
messages: 224114
nosy: eric.smith, mark.dickinson, skrah
priority: normal
severity: normal
status: open
title: Decimal and float formatting treat '%' differently for infinities and nans.
type: behavior
versions: Python 3.5

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


More information about the New-bugs-announce mailing list