且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在JavaScript中乘法int和float(double)

更新时间:2022-03-10 03:36:52

这是一个舍入误差。您可能希望将数字四舍五入为固定的数字位数,如下所示:

It's a rounding error. You may want to round your number to a fixed amount of digits, like this:

parseFloat((your_number).toFixed(2));