Quick: Format Specs in %

Thomas Heller theller at python.net
Thu Apr 25 02:26:00 EDT 2002


"Philip Swartzleonard" <starx at pacbell.net> wrote in message news:Xns91FA8B766EF98RASXnewsDFE1 at 130.133.1.4...
>
> '%2f' % some_number pads the number with 2 blank spaces
> '%.2f' % some_number fixes the number to 2 decimal places
>
> the problem:
> '%2.2f' % some_number only does the second of those two things. I need
> both. I tried looking up the % operator in the index of the language
> reference, but couldn't find it.
>
See the 'Python Manual Search':

http://starship.python.net/crew/theller/pyhelp.cgi?keyword=%25&version=current

Thomas





More information about the Python-list mailing list