I came across this:

>>> from sympy import Float
>>> Float(1.25343)
1.25343000000000

>>> '{0:.2f}'.format(Float(1.25343))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Unknown format code 'f' for object of type 'str'

Is this known/expected? Shouldn't it work?

This works:

>>> '{0:.2f}'.format(float(Float(1.25343)))
'1.25'


Thanks,
Amit.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CANODV3%3DimDsQj6H613GiW9ygqhpGLDJ34dLXCXZ_0h%3D%3Dndvsdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to