Math.round() メソッド


Math.round();

引数に数値型の値を取り、その数値を四捨五入して整数を返すメソッド。

Math.round(1.1);
// 1

Math.round(1.5);
// 2