Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 13 years ago

Jason Grout gravatar image

See the printf-like python string formatting options here

click to hide/show revision 2
No.2 Revision

See the printf-like python string formatting options here. As an example:

sage: "%0.2f"%pi
'3.14'
sage: "%e"%pi
'3.141593e+00'