Sybren Stuvel wrote: > Girish Sahani enlightened us with: >> I want to truncate every number to 2 digits after the decimal point.... >>>>> a = 2 >>>>> b = 3 >>>>> round(a*1.0 / b,2) >> 0.67000000000000004 > > If you want to format it, use '%.2f' % (float(a)/b)
Sybren has this right. If you follow everyone else's advice, you'll eventually discover: >>> print round(11024. / 5000.1, 2) only gives you "2.2", not "2.20" (which is what, I suspect, you want). --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list