Copyright © tutorialspoint.com

# Python Number round() Function

## Description:

This function returns x rounded to n digits from the decimal point.

## Syntax:

    round( x [, n]  )

## Parameters:

Here is the detail of parameters:

- x: This is a numeric expression.

- n: This is also a numeric expression.

## Return Value:

The x rounded to n digits from the decimal point.

## Example:

    #!/usr/bin/python

    print "round(80.23456, 2) : ", round(80.23456, 2)
    print "round(100.000056, 3) : ", round(100.000056, 3)
    print "round(-100.000056, 3) : ", round(-100.000056, 3)

This will produce following result:

    round(80.23456, 2) :  80.23
    round(100.000056, 3) :  100.0
    round(-100.000056, 3) :  -100.0

Copyright © tutorialspoint.com