JS的浮点数计算精度丢失问题解决方案

Math.formatFloat = function (f, digit) {
    var m = Math.pow(10, digit);
    return Math.round(f * m, 10) / m;
}

JS的浮点数计算精度丢失问题解决方案  

https://blog.csdn.net/u012143360/article/details/53148591

原文地址:https://www.cnblogs.com/ron123/p/9987759.html