How do I specify the printing precision for Sympy.pretty_print?

Viewed 57

I've been trying to figure this out from the Sympy docs, but I can't find any options or parameters that control precision for printed output. I don't want to change the precision of the stored numbers, I just don't need 17 digits of precision in my output. Any good way to do this?

import sympy as sp
sp.init_printing()  # presumably options would go here?

a = sp.pi
sp.pprint(sp.N(a))  # I'd like to see only a few digits here, not full precision
0 Answers
Related