If you must do this, then the easiest way will be to just use the built in formating, and then just replace the e+05 or e-12 with whatever you'd rather have:

def sci_notation(number, sig_fig=2):
    ret_string = "{0:.{1:d}e}".format(number, sig_fig)
    a, b = ret_string.split("e")
    # remove leading "+" and strip leading zeros
    b = int(b)
    return a + " * 10^" + str(b)

print sci_notation(10000, sig_fig=4)
# 1.0000 * 10^4
Answer from will on Stack Overflow
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ python scientific notation
Python Scientific Notation - Scaler Topics
October 10, 2025 - Let's take an example of the ... number above can also be written as ... 9.732 * 10^{-6}9.732โˆ—10โˆ’6 can be written as 9.732e-6....
๐ŸŒ
datagy
datagy.io โ€บ home โ€บ python posts โ€บ python scientific notation: converting and suppressing
Python Scientific Notation: Converting and Suppressing โ€ข datagy
October 24, 2022 - In order to convert a number to its scientific notation counterpart, you can simply set the first number (or the coefficient) to be between 1 and 10. Then multiply the number by its base ten value.
๐ŸŒ
Python Reference
python-reference.readthedocs.io โ€บ en โ€บ latest โ€บ docs โ€บ float โ€บ scientific.html
e | E (scientific notation) โ€” Python Reference (The Right Way) 0.1 documentation
>>> 1.1 1.1 >>> 1.1e0 1.1 # 1.1 * 10**0 >>> 1.1e1 11.0 # 1.1 * 10**1 >>> 1.1e2 110.0 # 1.1 * 10**2 >>> 1.1e3 1100.0 # 1.1 * 10**3 >>> 8e-2 0.08 # 8 * 10**-2
๐ŸŒ
Python.org
discuss.python.org โ€บ ideas
Let int accept scientific notation strings - Ideas - Discussions on Python.org
February 4, 2023 - Let int accept scientific notation strings, like float does (but with non-negative exponents only). This would allow scientific notation strings (e.g., command-line arguments specifying big integers) to be parsed directly without the loss of precision incurred by converting via float (e.g., int(float('1e23')) != 10**23).
๐ŸŒ
Syntx Scenarios
syntaxscenarios.com โ€บ home โ€บ python โ€บ python scientific notation: how to use, convert & remove it
Python Scientific Notation: How to Use, Convert & Remove it
October 21, 2024 - For instance, instead of writing โ€œ0.000000123,โ€ we can write โ€œ1.23 ร— 10โปโท.โ€ This form is shorter and more useful for calculations. In Python scientific notation, we use the letter โ€˜eโ€™ (or โ€˜Eโ€™) to show powers of 10.
๐ŸŒ
AskPython
askpython.com โ€บ home โ€บ suppressing scientific notation in python for float values
Suppressing Scientific Notation in Python for Float Values - AskPython
April 29, 2023 - There are some rules to using scientific notations. They are: The mantissa will always represent the main digits of the decimal number. The number should always be represented in base 10, that is, it must always be a decimal number.
๐ŸŒ
Python Pool
pythonpool.com โ€บ home โ€บ blog โ€บ python scientific notation with suppressing and conversion
Python Scientific Notation With Suppressing And Conversion - Python Pool
January 1, 2024 - So, let us take a number of 0.000001234 then to represent it in a scientific form we write it as 1.234 X 10^-6. For writing it in pythonโ€™s scientific form we write it as 1.234E-6. Here the letter E is the exponent symbol.
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ Scientific_notation
Scientific notation - Wikipedia
January 10, 2026 - Most popular programming languages โ€“ including Fortran, C/C++, Python, and JavaScript โ€“ use this "E" notation, which comes from Fortran and was present in the first version released for the IBM 704 in 1956.
Find elsewhere
๐ŸŒ
Sparrow Computing
sparrow.dev โ€บ home โ€บ blog โ€บ scientific notation in python and numpy
Scientific Notation in Python and NumPy - Sparrow Computing
October 15, 2021 - Python can deal with floating point numbers in both scientific and standard notation. This post will explains how it works in Python and NumPy.
๐ŸŒ
Reddit
reddit.com โ€บ r/pythontips โ€บ converting into a specific scientific notation
r/pythontips on Reddit: converting into a specific scientific notation
January 3, 2023 -

I got 2.7 * 106, which is 2700000.0 and I need it to be 270 * 104

there is a way to get this scientific notation? i really need this

๐ŸŒ
OverIQ
overiq.com โ€บ python-101 โ€บ numbers-in-python
Numbers in Python - Python Tutorial - OverIQ.com
The numbers written in the form a x 10^b is known as scientific notation. Scientific notation is quite useful for writing very small or very large numbers. For example, float 0.000000123 can be written succinctly in Scientific notation as 1.23 x 10^-7. Python uses special a syntax to write ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ display-scientific-notation-as-float-in-python
Display scientific notation as float in Python - GeeksforGeeks
July 23, 2025 - The scientific notation means any number expressed in the power of 10.for example- 340 can be written in scientific notation as 3.4 X102.in pythons, we use str.format() on a number with "{:e}" to format the number to scientific notation.
๐ŸŒ
Schmidscience
schmidscience.com โ€บ home โ€บ how โ€บ how to use python to enter scientific notation?
How To Input Scientific Notation In Python
December 21, 2025 - In Python, scientific notation uses 'e' or 'E' to represent powers of 10, facilitating the representation of very large or small numbers. The base (a) can be a float or integer, with 'e' indicating "times ten raised to the power of". The standard ...
๐ŸŒ
Substack
codedrome.substack.com โ€บ p โ€บ scientific-notation-in-python
Scientific Notation in Python - by Chris Webb - CodeDrome
January 27, 2026 - Then we need to check whether the ... whole project as they calculate the exponent and significand. The exponent is calculated by taking the base 10 logarithm ......
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ display-scientific-notation-as-float-in-python
Display scientific notation as float in Python
Step 3 ? Use the g format specifier ... notation based on the number ? ... Note that the precision and the format can be adjusted to suit your needs. In conclusion, there are various ways to convert and display the scientific notation as float in Python....