Issue #22090: Fix '%' formatting for infinities and NaNs.

This commit is contained in:
Stefan Krah 2014-08-26 20:46:49 +02:00
parent d84fd73de2
commit 298131a448
3 changed files with 14 additions and 4 deletions

View file

@ -3769,6 +3769,8 @@ class Decimal(object):
if self._is_special:
sign = _format_sign(self._sign, spec)
body = str(self.copy_abs())
if spec['type'] == '%':
body += '%'
return _format_align(sign, body, spec)
# a type of None defaults to 'g' or 'G', depending on context