python float保留两位小数

res = 1.015
res = round(res, 2)  # 保留两位小数,1.01
原文地址:https://www.cnblogs.com/judes/p/12673389.html