小编tom*_*ton的帖子

如何格式化具有给定精度和零填充的浮点数?

我看了几十个类似的问题 - 我很高兴能得到另一个答案的链接 - 但我想在python 3.3中填零一个浮点数

n = 2.02
print( "{?????}".format(n))
# desired output:
002.0200
Run Code Online (Sandbox Code Playgroud)

浮点的精度很容易,但我不能得到零填充.什么进入????的

python string string.format python-3.x

6
推荐指数
1
解决办法
1524
查看次数

标签 统计

python ×1

python-3.x ×1

string ×1

string.format ×1