First time here? Check out the FAQ!
answered 10 years ago
I find that the easiest way to to convert to a python floating point before printing.
float(24/5) #-> 4.8 "%.4f" % float(26/3) #-> 8.6667