我试图对一个整数使用两个格式说明符,但我不知道正确的语法。我想格式化一个大数字以使用逗号,并四舍五入到两位小数。print('Total = ${0:,}{0:.2f}'.format(total))
#prints total once with commas, then prints total again with two decimal places but no commas.编写打印命令的正确方法是什么,以便用逗号和两个小数位打印一次总数?
添加回答
举报
0/150
提交
取消