Re: Output: Number of digits in exponent?

2005-12-06 Thread Paul Rubin
Jens Bloch Helmers <[EMAIL PROTECTED]> writes: > How can I control the number of digits in the exponent when writing > floats to a file? It seems that Python2.4.2(winXP) prints three > digits anyway. > > >>> print 1.0e50 > 1e+050 That's weird; must be version and/or OS dependent. On Fedora Core

Re: Output: Number of digits in exponent?

2005-12-06 Thread danplawson
'%.4e' % 1.0e50 -- http://mail.python.org/mailman/listinfo/python-list

Output: Number of digits in exponent?

2005-12-06 Thread Jens Bloch Helmers
How can I control the number of digits in the exponent when writing floats to a file? It seems that Python2.4.2(winXP) prints three digits anyway. >>> print 1.0e50 1e+050 >>> print '%e' % (1.0e50) 1e+050 I would prefer two digits in the exponent. Usually 3 digits is not a problem, except for wais