Alan G Isaac wrote:
The documentation at http://docs.python.org/py3k/library/string.html#format-specification-mini-language

'<' Forces the field to be left-aligned within the available space (This is the default.)

The conflicting example::

        >>> format(3.2,'10.5f')
        '   3.20000'
        >>> format(3.2,'<10.5f')
        '3.20000   '

Am I somehow misreading the documentation?

It does look misleading. Numbers default to right-aligned, as you
discovered.

You usually want numbers to be right-aligned so that the decimal points
line up when writing a columns of them.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to