Math.abs()
绝对值
Math.round()
四舍五入变整型
Math.ceil()向上取整
Math.ceil(1.1) ;//2
Math.floor()向下取整
Math.floor(1.1);//1
Math.max()
求最大值
Math.min()
求最小值
Math.random()
左闭右开 0~1
parseInt(string)
parseInt('1.1'); //1
parseInt('1b2.4'); //1
parseInt('w'); //NaN
只能识别数字
parseFloat(string)
parseFloat('100.1'); //100.1
parseFloat('12.4b5'); //12.4
parseInt('w'); //NaN
Number(value)
Number('100.1');//100.1
Number('12.4b5')//NaN
num.toFixed(digits)
(100.123).toFixed(2); //"100.12"
(100.123).toFixed(0); //"100"