I need a very specific string format for floats in python.
I need all numbers to look like this:
0.313575791515242E+005
0.957214231058814E+000
0.102484469467859E+002
0.251532655168561E-001
0.126906478919395E-002
-0.469847611408333E-003
They always start with a 0.x with 15 digits after the decimal point and end with 3 digits in the exponential.
Can I do this with python? I tried to look at the documentation for string formatting but couldn't figure out how.
I tried with this:
>>> number = 9.622
>>> print(f'{number:.15E}')
9.622000000000000E+00
Which is pretty close, but I still need the leading 0 and 3 digits in the exponent. It has to be like this:
0.962200000000000E+001
Any help is appreciated!