我想用小数点后两位数来格式化我的浮点数。
>>> x =5.0 >>> y=float("{:0.2f}".format(x)) >>> y 5.0
我想要这种格式的输出:
5.00
python format
format ×1
python ×1