sage: round(x,2)
0.0
To show it really does what you want:
sage: round(1.2345,2)
1.23


On May 2, 8:35 pm, Fidel <fidel.barr...@gmail.com> wrote:
> Hello,
>
> I think I tried to post this about an hour ago, but the discussion
> didn't show up. So I'm doing it again, sorry in case it is repeated.
>
> I am working in sage 3.4.1
>
> I am trying to define a function to get the LaTeX string of a graph,
> so I am trying to convert a number to string.
>
> I have x=6.1230317691118863e-17, which I got from
>
> sage: x=graphs.PetersenGraph().get_pos()[0][0]
>
> I would like a two decimal approximation of x, that is 0.00.
>
> I have tried
>
> sage: numerical_approx(x,digits=2)
> 6.1e-17
> sage: n(x,digits=2)
> 6.1e-17
>
> Is there a way to get 0.00 as output?
>
> Thanks in advance for your attention and help.
>
> Greetings,
> Fidel
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to