摘要: 方式一:format() format(1.235, '.2f') Out[1]: '1.24' format(1.2, '.2f') Out[2]: '1.20' format(1.2, '.3f') Out[3]: '1.200' 返回值为字符串类型,末位会自动补0 方式二:round() ro 阅读全文
posted @ 2022-12-18 00:21 eliwang 阅读(1945) 评论(0) 推荐(0) 编辑