Ask Your Question

Kevin Cox's profile - activity

2015-03-11 06:15:50 -0600 received badge  Teacher (source)
2015-03-11 06:15:50 -0600 received badge  Necromancer (source)
2015-03-10 17:50:08 -0600 answered a question formatting numbers in sagetex

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