getting rid of leading zeros in float expotential

tom at finland.com tom at finland.com
Sun Jun 3 03:47:48 EDT 2007


Hi! I'm wondering whether there's an easy way to remove unnecessary 
leading zeros from my floating point number.

realS = float(-1.25e-5)
imgS = float(-7.6e4)

print complex(realS, imgS)

 >> (-1.25e-005-76000j)

I would like it to look like (-1.25e-5-76000j)



More information about the Python-list mailing list