mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Issue #6857: Fix Decimal formatting to be consistent with existing float
formatting: both are now right-aligned by default.
This commit is contained in:
parent
81809a42c1
commit
5cfa8044ff
3 changed files with 9 additions and 2 deletions
|
@ -5497,7 +5497,10 @@ def _parse_format_specifier(format_spec, _localeconv=None):
|
|||
raise ValueError("Alignment conflicts with '0' in "
|
||||
"format specifier: " + format_spec)
|
||||
format_dict['fill'] = fill or ' '
|
||||
format_dict['align'] = align or '<'
|
||||
# PEP 3101 originally specified that the default alignment should
|
||||
# be left; it was later agreed that right-aligned makes more sense
|
||||
# for numeric types. See http://bugs.python.org/issue6857.
|
||||
format_dict['align'] = align or '>'
|
||||
|
||||
# default sign handling: '-' for negative, '' for positive
|
||||
if format_dict['sign'] is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue