Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Python Programming Language

getting rid of leading zeros in float expotential


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)

On 3    , 11:47, t@finland.com 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))
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc