I want to print decimal numbers in scientific notation e.g. 1e-5. Is there any function in Python for it?

+2 votes

Best answer

You can display a decimal number in scientific notation without using any function.

In the following example, there will be two digits after the decimal point. If you want more digits after the decimal point, you can change 2 to the number of digits you want.

>>> print("{:.2e}".format(0.00038625))

3.86e-04