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
I wanted to do the same thing, but with 5 instead of 10, and came up with a simple function. Hope it's useful:
def roundToFive(num): remaining = num % 5 if remaining in range(0, 3): return num - remaining return num + (5 - remaining)