You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Activity
skrah commentedon Sep 7, 2009
format(float("0.12345"), "7.0") -> ' 0.1'
The default alignment should be 'left-aligned'.
mdickinson commentedon Sep 7, 2009
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.
ericvsmith commentedon Sep 7, 2009
That is interesting. I'd agree that it's a bug in the PEP. Note that
%-formatting right aligns floats by default:
I'll raise the issue on python-dev.
Eric.
mdickinson commentedon Sep 8, 2009
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:
http://mail.python.org/pipermail/python-dev/2009-September/091640.html
ericvsmith commentedon Sep 8, 2009
Thanks for the decimal work, Mark. I notice that complex is also left
aligned, by default. I'll take a look at that.
ericvsmith commentedon Feb 22, 2010
With the fixes for complex in bpo-7988, I believe this issue is completed.