Name

round()

Examples
x = 9.2
rx = round(x)  # Sets 'rx' to 9
y = 9.5
ry = round(y)  # Sets 'ry' to 10
z = 9.9
rz = round(z)  # Sets 'rz' to 10
Description Calculates the integer closest to the n parameter. For example, round(133.8) returns the value 134.
Syntax
round(n)
Parameters
nfloat: number to round
Related floor()
ceil()

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.