Zac*_*ach 2 python floating-point notation
将浮点数写入CSV会像下面这样写入其中一些:2.0628800997782577e-05
c = csv.writer(open(file, "wb"))
c.writerow([var1, var2])
Run Code Online (Sandbox Code Playgroud)
我尝试过的:
这使得以后很难处理excel中的输出,因为它被识别为文本而不是数字.如何以非科学的十进制表示法打印?
'%f' % your_var
Run Code Online (Sandbox Code Playgroud)
或者控制精度:
'%0.10f' % your_var
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2496 次 |
最近记录: |