Math.round(A * Math.pow(10, i)) /Math.pow(10, i); A表示待四舍五入的数字 i表示保留小数点几位数 其中Math.pow(10, i)表示10的i次方 例如: Math.round(14.235568941 * Math.pow(10, 2)) /Math.pow(10, 2); 结果:14.24 Math.round(14.234568941 * Math.pow(10, 2)) /Math.pow(10, 2); 结果:14.23