标签: javascript jquery
如何动态地将此值“1153.7759999999999”舍入到1153.78
答案 0 :(得分:0)
试试这个:
var num =1153.7759999999999; var result=Math.round(num * 100) / 100;
答案 1 :(得分:0)
您正在寻找.toFixed(2)
.toFixed(2)
var num = 1153.7759999999999; console.log(num.toFixed(2));