数字格式
给定一个数字,要求输出,保留两位小数,添加千位分隔符
num: float = 1234567.8954
print(f"the number is {num:,.2f}")
# the number is 1,234,567.90
Try it on playground
给定一个数字,要求输出,保留两位小数,添加千位分隔符
num: float = 1234567.8954
print(f"the number is {num:,.2f}")
# the number is 1,234,567.90
Try it on playground