어떤 숫자에 가장 가까운 정수를 계산합니다.
예를 들어, round(133.8)는 134라는 값을 반환합니다.
두번째 매개변수인 decimals은 선택 사항입니다. 반올림할 때 사용할 소수점의 자리 수를 설정합니다. 예를 들어, round(12.34, 1)은 12.3을 반환합니다. decimals의 기본값은 입니다.
예제
구문
round(n, [decimals])
매개변수
n
Number:
반올림할 숫자
decimals
Number:
반올림할 소수점 자리 수 (기본값 0)
Returns
Integer: 반올림된 숫자
This page is generated from the comments in src/math/calculation.js . Please feel free to edit it and submit a pull request!