45

I have a number that prints out in exponential form:

>>>
>>> a = 1/1221759
>>> print(a)
8.184920266599223e-07
>>>

How can i make it print in normal form?

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
kafedakias
  • 537
  • 1
  • 6
  • 10

2 Answers2

69

You can format it as a fixed-point number.

>>> a = 1/1221759
>>> '{0:.10f}'.format(a)
'0.0000008185'
Jeff Mercado
  • 129,526
  • 32
  • 251
  • 272
10

You can use print formatting:

print "%.16f" % a

where 16 is the number of digits you want after the decimal point.

Jimtronic
  • 1,179
  • 1
  • 9
  • 22