On Sep 13, 3:50 pm, Harlin Seritt <[EMAIL PROTECTED]> wrote:
> Cant believe I have to post this and get help... and can't believe I
> couldnt Google it reasonably well enough... I need to take a float
> variable and have it display as a string to always have two decimal
> places:
>
> 12.3333 -> 12.33
> 1.0 -> 1.00
> etc...
>
> Anyone willing to help with this one?

>>> a
12.33333
>>> print '%0.2f' % a
12.33
>>> a = 1
>>> print '%0.2f' % a
1.00


>
> thanks,
>
> Harlin


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to