#grid system
17 messages · Page 1 of 1 (latest)
local function Round(num, int)
local divided = num / int
local rounded = int * math.floor(divided)
return rounded
end
print(Round(83, 5))
;compile
Program Output
80
paulogarithm#0000 | lua | lua-5.4.3 | wandbox.org
Developer Forum | Roblox
You can write your topic however you want, but you need to answer these questions: What do you want to achieve? Keep it simple and clear! I want to be able to round a number like 1107 to the nearest 5, like 1105. What is the issue? Include screenshots / videos if possible! I am not able to do ^^^ What solutions have you tried so far? ...
and you round for your block placement$
dependsing on their size
youre the singular most helpful person in this server
@viscid topaz Why math.floor and not math.round tho?
math.floor is bringing your value to the floor, it means that math.floor(4.9) -> 4