1,Math.ceil()方法向上取整,整数部分值+1:
eg:Math.ceil(3/2) 输出:2
2,Math.floor()方法向下取整,整数部分值不变:
eg:Math.floor(3/2) 输出:1
3,Math.round()方法四舍五入取整:
eg:Math.round(3/2) 输出:2
4,parseInt()方法 抛去小数部分,只取整数部分:
eg:parseInt(3/2) 输出:1
1,Math.ceil()方法向上取整,整数部分值+1:
eg:Math.ceil(3/2) 输出:2
2,Math.floor()方法向下取整,整数部分值不变:
eg:Math.floor(3/2) 输出:1
3,Math.round()方法四舍五入取整:
eg:Math.round(3/2) 输出:2
4,parseInt()方法 抛去小数部分,只取整数部分:
eg:parseInt(3/2) 输出:1