PythonBuilt-inround
abs

roundBuilt-in

hasattr

Rounds a number to a given number of decimal places.

Syntax

round(number, ndigits?)

Example

Enter values below to update the example in real time.

print
banker
rounding
print(round(3.14159, 2))   # 3.14
print(round(2.5))          # 2  (banker's rounding)
print(round(3.5))          # 4