round有坑,不是常人理解的四舍五入,所以不建议用
可以使用decimal来解决
例:data_except[subject]保留2位小数
from decimal import * getcontext().rounding = ROUND_HALF_UP data_except[subject] = eval(productInfo[subject]).__round__(2)