摘要: python保留小数位的方法 format函数 print('{:.3f} {:.2f}'.format(1.23456,0.1256))#1.235 0.13 :.3f :3f表示保留3位有效数字 print(format(1.2345,'.2f'))#1.23 .2f :表示小数点后保留两位有效 阅读全文
posted @ 2021-03-11 22:54 辰-月 阅读(6878) 评论(0) 推荐(0)