0

In my program I am calculating large number of values and I want to write the calculated values according to scientific notation as an example it should be as follow.

0.16200000000    should be   1.6200000000e-01
6.09756097560    should be   6.0975609756e+00

Which function results this out put.

Shanaka
  • 735
  • 6
  • 14
  • possible duplicate of [Python - How to convert decimal to scientific notation](http://stackoverflow.com/questions/6913532/python-how-to-convert-decimal-to-scientific-notation) – nerdwaller Jul 03 '14 at 21:13

2 Answers2

2

'%e' % (number)

The %e format specifier is the specifier for scientific notations. Find out more here: https://docs.python.org/2/library/string.html

Strikeskids
  • 3,932
  • 13
  • 27
1

'%.10e' % (your value)

This is the easiest way to convert in to scientific notation.

user3187811
  • 267
  • 1
  • 2
  • 9