We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
assignee = 'https://github.com/ericvsmith'
closed_at = <Date 2010-02-22.19:30:44.566>
created_at = <Date 2009-09-07.15:46:46.809>
labels = ['type-bug']
title = 'float().__format__() default alignment'
updated_at = <Date 2010-02-22.19:30:44.565>
user = 'https://github.com/skrah'
activity = <Date 2010-02-22.19:30:44.565>
actor = 'eric.smith'
assignee = 'eric.smith'
closed = True
closed_date = <Date 2010-02-22.19:30:44.566>
closer = 'eric.smith'
components = 
creation = <Date 2009-09-07.15:46:46.809>
creator = 'skrah'
dependencies = 
files = 
hgrepos = 
issue_num = 6857
keywords = 
message_count = 6.0
messages = ['92370', '92378', '92379', '92431', '92432', '99817']
nosy_count = 3.0
nosy_names = ['mark.dickinson', 'eric.smith', 'skrah']
pr_nums = 
priority = 'normal'
resolution = 'accepted'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue6857'
versions = ['Python 2.6', 'Python 3.0', 'Python 3.1', 'Python 2.7']
The text was updated successfully, but these errors were encountered:
format(float("0.12345"), "7.0") -> ' 0.1'
The default alignment should be 'left-aligned'.
Sorry, something went wrong.
Hmm. PEP-3101 does indeed say that left-aligned is the default, but it's
a bit of a strange default for numeric types. I'd expect integers (at
least) to be right-aligned by default.
I'd be inclined to say that the current float formatting is correct, and
that it's the Decimal formatting that's wrong.
That is interesting. I'd agree that it's a bug in the PEP. Note that
%-formatting right aligns floats by default:
>>> '%7.0g' % 0.12345
I'll raise the issue on python-dev.
I've changed the default alignment for Decimal instances to right-aligned
(so that it agrees with floats and ints) in r74723 (trunk), r74725 (py3k),
as agreed in the python-dev thread starting at:
Thanks for the decimal work, Mark. I notice that complex is also left
aligned, by default. I'll take a look at that.
With the fixes for complex in bpo-7988, I believe this issue is completed.
No branches or pull requests