![](/img/trans.png)
[英]how to decrease the decimal places in the mantissa part of an exponential number in an output in python
[英]How to convert a negative exponential number into a decimal number in Python?
例如,我很难转换以下数字:
-1.9443404027234424e+46
-1.9443404027234425e+36
以没有科学记数法的格式(例如,也就是像0.04256
这样的浮点数)。
您可以使用:f
格式说明符:
>>> print("{:.0f}".format(-1.9443404027234424e+46))
-19443404027234423757622069004479676797119627264
请注意,由于浮点精度,结果可能不会以 46 个零结尾。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.