mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue #22090: Fix '%' formatting for infinities and NaNs.
This commit is contained in:
parent
d84fd73de2
commit
298131a448
3 changed files with 14 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue