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.
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)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.