Quick: Format Specs in %
Emile van Sebille
emile at fenx.com
Wed Apr 24 16:54:03 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.
Are you looking for %8.2f ?
--
Emile van Sebille
emile at fenx.com
---------
More information about the Python-list
mailing list