Math.round(要转化的数);
这种方法是四舍五入的。
例如:var x1 = Math.round(11.3);
var x2 = Math.round(11.6);
那么结果为:x1 == 11
x2 == 12