Reputation: 19
The question is simple: If I have a number x = 2.8e-11
and I want to print it in this format: 2.8 · 10^(-11)
, what should I do?
Thank you in advance.
Upvotes: 0
Views: 74
Reputation: 11063
I would just do this with string operations.
>>> x = 2.8e-11
>>> if 'e' in str(x):
print(str(x).replace('e', ' · 10^(') + ')')
2.8 · 10^(-11)
Upvotes: 1