function round(exact, quantum) local quant,frac = math.modf(exact/quantum) return quantum * (quant + (frac > 0.5 and 1 or 0)) end