问题你想对浮点数执行指定精度的舍入运算。
解决方案对于简单的舍入运算,使用内置的 round(value, ndigits) 函数即可。比如:
python float的四舍五入
原文:https://www.cnblogs.com/QimiSun/p/10417678.html