js数字取整的方法

parseInt(123.34)=123(保留整数)
Math.ceil(123.34)=124(向上取整)
Math.floor(123.34)=123(向下取整)
Math.round(123.34)=123,Math.round(123.56)=124四舍五入
123.234.toFixe(2)=123.23保留两位小数

posted @ 2022-11-10 17:12  木莲  阅读(399)  评论(0)    收藏  举报