Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

A Little Math help??

Asked by 10 years ago

I know what math.floor does. I just have a small question, if I do a = math.floor(b, 10)will that round down to the nearest 10?

1 answer

Log in to vote
0
Answered by 10 years ago

You can divide a number by 10 then round it down. Then multiply it by 10 again. Example:

local number=26
print(math.floor(number/10)*10)

Output: 20

0
Do you have any idea how my question got a -1? It's not a request is it? fahmisack123 385 — 10y
0
Someone voted it down, and your right it isn`t a request. 73epic311 13 — 10y
Ad

Answer this question