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

Does Roblox Studio automatically round small numbers down?

I have a script that needs to turn a part 180 Degrees in exactly 6.5 seconds. When I do 6.5/180, I end up with 0.03611111. Will Roblox round it down to 0.036?

I've read similar articles that say the minimum is 0.03, but does Roblox consider anything past hundredths insignificant figures?

2 comments

0

It will not round down for just math itself. It only rounds down when used in certain functions, such as wait().

0

yeah that won't round

1 answer

✓ Accepted answer

The number will not be rounded. However, decimal places have a limit. (floating point, I think?) Meaning if I did print(3.141592653589793238462643383279), the output would be 3.1415926535898. Noticeable difference, right?

There are two functions to round a number, though: math.floor and math.ceil. floor will return the lowest number, while ceil will return the highest.

Neither will return a number with a decimal.

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