From 298131a44896a4fec1ea829814ad52409d59aba5 Mon Sep 17 00:00:00 2001 From: Stefan Krah Date: Tue, 26 Aug 2014 20:46:49 +0200 Subject: Issue #22090: Fix '%' formatting for infinities and NaNs. --- Lib/decimal.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Lib/decimal.py') diff --git a/Lib/decimal.py b/Lib/decimal.py index 5b984731b2..e11f1a0082 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -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 -- cgit v1.2.1