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

How do I round up a number?

Asked by 10 years ago
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
math.floor(number) rounds down and math.ceil(number) rounds up. ForeverDev 155 — 10y

1 answer

Log in to vote
1
Answered by
Bebee2 195
10 years ago

math.floor(number) rounds down a number.

0
thanks! CardboardRocks 215 — 10y
Ad

Answer this question