方法一:使用x | 0,快速实现去除小数位保留整数。 console.log(99.55 | 0); // 99 console.log(33.55 | 0); // 33方法二:使用.tofixed(0),保留小数 ...
確定! 回上一頁