Math.floor() 向下取整Math.floor(3.141592654) // 3Math.ceil() 向上取整Math.floor(3.141592654) // 4Math.round() 四舍五入Math.round(3.141592654) // 3parseInt() 去掉小数点和小数点后的部分parseInt(3.141592654) // 3~~ 将数据转化为Number类型~~3.141592654 // 3
Math.floor() 向下取整Math.floor(3.141592654) // 3Math.ceil() 向上取整Math.floor(3.141592654) // 4Math.round() 四舍五入Math.round(3.141592654) // 3parseInt() 去掉小数点和小数点后的部分parseInt(3.141592654) // 3~~ 将数据转化为Number类型~~3.141592654 // 3