JavaScript数値Math.round
Math.floor

Math.round数値

Math.max

四捨五入した整数を返します。

문법

Math.round(x)

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

console
Math
console.log(Math.round(4.5));    // 5
console.log(Math.round(4.4));    // 4
console.log(Math.round(-4.5));   // -4