<[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hullo all !
>
> i have a real easy one here that isn't in my book.
> i have a int number that i want to divide by 100 and display to two
> decimal places.
>
> like this float(int(Var)/100)

At present, int/int truncates, so this won't do what you want.  Use 
int/100.0 to get float you want.  For output, use % formating operator with 
f specification.

>>> '%7.2f' % (50/100.0)
'   0.50'

Terry J. Reedy



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

Reply via email to