I am trying to round integers in python. I looked at the built-in round() function but it seems that that rounds floats.
My goal is to round integers to the closest
round() can take ints and negative numbers for places, which round to the left of the decimal. The return value is still a float, but a simple cast fixes that:
>>> int(round(5678,-1)) 5680 >>> int(round(5678,-2)) 5700 >>> int(round(5678,-3)) 6000