# "round to the nearest number lua" Code Answer's

You're definitely familiar with the best coding language Lua that developers use to develop their projects and they get all their queries like "round to the nearest number lua" answered properly. Developers are finding an appropriate answer about round to the nearest number lua related to the Lua coding language. By visiting this online portal developers get answers concerning Lua codes question like round to the nearest number lua. Enter your desired code related query in the search bar and get every piece of information about Lua code related question on round to the nearest number lua.

### lua round number

By pplew on Dec 04, 2020
``````local number = 15.57
local number2 = 15.23

print(math.floor(number + 0.5)) --16
print(math.floor(number2 + 0.5)) --15``````

3

### round to the nearest number lua

By Thankful Termite on Apr 13, 2021
``````--You can round answers to the nearest multiple of a number
--For example, rounding 13 to the nearest multiple of 3 is 12, since 12 is
--divisible by 3
local number = 15.2
local multiple = 3 --the multiple you choose

--Or just round to the nearest whole number
print(math.floor(number + 0.5))``````