On 3 , 11:47, [EMAIL PROTECTED] wrote: > 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)
why? For printing? try to process it as a string >>>def my_func(a): return my_del_zeros_func(str(a)) -- http://mail.python.org/mailman/listinfo/python-list