summaryrefslogtreecommitdiff
path: root/Lib/decimal.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-09-08 20:20:19 +0000
committerMark Dickinson <dickinsm@gmail.com>2009-09-08 20:20:19 +0000
commit5cfa8044ff9fd26dc4915fc2ce5b2d005eea3261 (patch)
treed9e4c236a0ed095d02491c6a49df1fa239f0f79d /Lib/decimal.py
parent81809a42c1639ab6f49900eea15808bf71c6e567 (diff)
downloadcpython-git-5cfa8044ff9fd26dc4915fc2ce5b2d005eea3261.tar.gz
Issue #6857: Fix Decimal formatting to be consistent with existing float
formatting: both are now right-aligned by default.
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r--Lib/decimal.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index a87a4a5411..4d1f7f9f15 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -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: