control precision for str(obj) output?
bpeng at rice.edu
Wed May 4 03:34:50 CEST 2005
I have enjoyed the convenience to output any object with str(obj) for a
while. However, I get long output for things like str([0.0002]) in my
output (which bothers my users more than me though). I also do not
understand why the following is happening:
Is there any way to fix this, other than checking the type of everything
and output with %.4f?
Many thanks in advance.
More information about the Python-list