If you just want to safely print numbers with the trailing zeros removed, used strip:
a = 12.0000000000 b = 0.80000 str(a).rstrip('0') str(b).rstrip('0') On Thu, May 29, 2014 at 9:53 AM, Dominique Laurain <dominique.laurai...@orange.fr> wrote: > We get in trouble with your question, because you used "simplify" > verb...which should have been refering to other SAGE simplifying functions > (floor, simplify symbolic expression and so on).... when you wanted to > "display only few significant digits of that real number". > > Function for you is : n(digits=...) > > Try this in cell to understand better : > > m = 12.0000000 ; print m > print type(m) > mr = m.n(digits=3) ; print mr > print type(mr) > x = m - mr + 1; print x > print type(x) > y = x.n(digits=5) ; print y > print type(y) > z = y ; print z > print type(z) > u = 1.000 > ur = u.n(digits=8) ; print ur > print "n() is attribute of object RealNumber :" > print z > print ur > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-support+unsubscr...@googlegroups.com. > To post to this group, send email to sage-support@googlegroups.com. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.