round
The round() method rounds a number to the nearest integer. If the decimal part is exactly 0.5, the number is rounded to the next higher integer.
Interactive example
Syntax
typescript
function round<
GenericInput extends number
>(
input: GenericInput
): numberParameters
input: The number to round.
Return value
The number rounded to the nearest integer.
