round
mathRounds to the nearest integer
Syntax
round(number) Parameters
number (number) The number to round
Returns
number The nearest integer to the input
Examples
Input:
3.5 | round Output:
4 Input:
3.4 | round Output:
3 Input:
round(2.8) Output:
3 The round() function rounds to the nearest integer, using standard rounding rules (0.5 and above rounds up).
Usage
Use round() for general-purpose rounding when you need the closest integer value.