# When the optional ndig option is given, round() will round the argument to the specific number of decimal places.
print round(3)
print round(3.45)
print round(3.4999999)
print round(3.4999999, 1)
import math
for eachNum in range(10):
print round(math.pi, eachNum)
print round(-3.5)
print round(-3.4)
print round(-3.49)
print round(-3.49, 1)
13.42.round |
| 13.42.1. | round(flt,ndig=0) rounds a floating point number to the nearest integral number |