Skip to main content

Math: round

Round, Ceil or Floor the given number.

  • Round rounds to the nearest integer, using banker's rounding (half to even) at exact midpoints: 2.5 → 2 and 3.5 → 4.
  • Ceil always rounds toward positive infinity: -3.9 → -3.
  • Floor always rounds toward negative infinity: -3.1 → -4.
Example
# Example with Ceil:
Input: 3.4
Ouput: 4.0

Input: -3.9
Ouput: -3.0

# Example with Floor:
Input: 3.4
Ouput: 3.0

Input: -3.9
Ouput: -4.0

# Example with Round:
Input: 3.4
Ouput: 3.0

Input: 3.9
Ouput: 4.0

# Round at midpoints (banker's rounding, half to even):
Input: 2.5
Ouput: 2.0

Input: 3.5
Ouput: 4.0

Parameters

Round mode

Select which mode to apply to input number: Round, Ceil, Floor. Optional — defaults to Round.

Input

Numberrequired
The number to round.

Output

Number

Result of the round/ceil/floor operation