丢弃小数部分,保留整数部分parseInt(5/2) ```` 向上取整,有小数就整数部分加1 ====Math.ceil(5/2) 四舍五入 ==== ```javascript Math.round(5/2)向下取整Math.floor(5/2)
XGR's Blog
积知累识 分享有用