四舍五入为整数。
console.log(Math.round(0.60)) // 1 入
console.log(Math.round(0.50)) // 1 入
console.log(Math.round(0.49)) // 0 舍
console.log(Math.round(-4.40)) // -4 舍
console.log(Math.round(-4.60)) // -5 入
四舍五入为整数。
console.log(Math.round(0.60)) // 1 入
console.log(Math.round(0.50)) // 1 入
console.log(Math.round(0.49)) // 0 舍
console.log(Math.round(-4.40)) // -4 舍
console.log(Math.round(-4.60)) // -5 入