Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Have I used the floor function right to round the number down?

Will this output 10?

v = 10.4
v(math.floor)
print(v)

1 comment

0

I have tested but it just throw some error.

1 answer

✓ Accepted answer

No it will not.

You are using math.floor() incorrectly.

To use it correctly, you'll have to do it like this:

v = 10.4
local v = math.floor(v)
print(v)

The reason it won't work is because math.floor() is a function. You also are using it completely incorrectly in that you are trying to use math.floor() in a very weird way.

For more information, read the following:

https://developer.roblox.com/en-us/api-reference/lua-docs/math

This discussion is preserved as it was. New answers, comments, and votes are closed.