js四舍五入保留保留两位小数 tofixed()
var num = 1.123456887755412;
console.log('保留两位小数:'+num.tofixed(2)+'-----保留四位小数"+num.tofixed(4))
js四舍五入保留保留两位小数 tofixed()
var num = 1.123456887755412;
console.log('保留两位小数:'+num.tofixed(2)+'-----保留四位小数"+num.tofixed(4))
转载于:https://www.cnblogs.com/Chestnut-LYN/p/10605878.html