I've been trying to write a function that rounds a number to the multiple of 4 with the least absolute distance from the number. How do I do this?
I honestly have absolutely no clue how to do this, please help me.
You can use this simple script :)
function Round(Number,Nearest) return math.floor(Number/Nearest + 0.5)*Nearest end Round(321,4)