I have a very silly question, suppose if i have a number 1.70000043572e-05
how should I convert it into float i.e. 0.0000170000043572
.
You need to convert to a float and use str.format specifying the precision:
In [41]: print "{:f}".format(float("1.70000043572e-05"))
0.000017
# 16 digits
In [38]: print "{:.16f}".format(float("1.70000043572e-05"))
0.0000170000043572
Just calling float would give 1.70000043572e-05
.
Using older style formatting:
In [45]: print( "%.16f" % float("1.70000043572e-05"))
0.0000170000043572
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With