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 round up a number?

text = script.Parent.Parent.Input.Text
credits = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.StarterPack.Player.Credits.Value
points = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.StarterPack.Player.Points.Value
premium = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.StarterPack.Player.Premium.Value

script.Parent.MouseButton1Click:connect(function()
	if premium == true and credits >= text then
		credits = credits - text
		points = points + (text / 1000)
	end
end)

I have this where the text doesn't have to be a multiple of 1000, so you can get a decimal answer. How do I make it where it rounds the number down?

1 comment

1

math.floor(number) rounds down and math.ceil(number) rounds up.

1 answer

✓ Accepted answer

math.floor(number) rounds down a number.

1 comment

0

thanks!

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