The round()
function is used to round a number to a specified number of decimal places. It returns a floating point number rounded off to the given digits precision.
round(number, ndigits = 0)
copy
The required argument, number
, specifies the number to be rounded off. The optional second argument, ndigits
, specifies the number of decimal places to which the number should be rounded off, it defaults to 0, meaning that the number is rounded off to the nearest integer.