Home >>Python Built-in Functions >Python round() Function
Python round() function is used to return a floating-point number that is a rounded value of the given input number with the specified number of decimals. The default number of decimals is 0 which means that the function will return the nearest integer.
Syntax:round(number, digits)
Parameter | Description |
---|---|
number | This is a required parameter. It defines the number to be rounded. |
digits | This is an optional parameter. It defines the number of decimals to use when rounding the number. |
x = round(7.46723)
print(x)
x = round(7.46723, 3)
print(x)