1. Math.round、 Math.ceil 和 Math.floor
Math.round ----四舍五入 Math.round(3.5) = 4
Math.ceil -----进位 Math.ceil(2.001) = 3
Math.floor -----退位 Math.floor(3.888) = 3
保留两位小数:
var xx = 1.3453434;
Math.round(xx*100)/100.0;
1. Math.round、 Math.ceil 和 Math.floor
Math.round ----四舍五入 Math.round(3.5) = 4
Math.ceil -----进位 Math.ceil(2.001) = 3
Math.floor -----退位 Math.floor(3.888) = 3
保留两位小数:
var xx = 1.3453434;
Math.round(xx*100)/100.0;