JavaScriptNumberMath.round
Math.floor

Math.roundNumber

Math.max

Returns the value of a number rounded to the nearest integer.

문법

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