int x = 6.3456824221 #round(number_to_roundoff, round_off_till) #round_off_till is optional print(round(x)) #output: 6 print(round(x, 3)) #output: 6.346 print(round(x, 1) #output: 6.3
int(round(x))
def myround(x, base=5): return base * round(x/base)
Variable = int(round(Variable))
def myround(x, prec=2, base=.05): return round(base * round(float(x)/base),prec)