python格式化字符串保留2位小数

点击查看代码
a = 3.1415926
print(f'{a:.2f}')

posted @ 2024-09-13 10:13  神仙不在  阅读(13)  评论(0)    收藏  举报