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

How do i only use the numbers before the dot?

Hello i would like to ask how i only show the numbers (Gui) before the dot, Example: I have the number 41.542 and how i only show 41

1 comment

0

You mean you want the numbers out of 1000 in a decimal?

1 answer

✓ Accepted answer

There are a lot of ways to do this, one way is to use string formatting which uses Specifiers to format the string:-

print(string.format('%d', 41.4502))

Output:- 41

Other methods would be to use math.floor() if you wanted an integer. I hope this helps.

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