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

Why is rounding still giving decimal numbers?

Asked by 8 years ago

Not much to say really but just that when make my server age counter, it is not rounding the numbers, despite me using math.ceil(Number + Closest). anyway I need some hepl with this script!

01local TempNumber
02 
03game.ServerStorage.ServerAge.Changed:connect(function()
04    if game.ServerStorage.ServerAge.Value < 60 then
05        script.Parent.Text = game.ServerStorage.ServerAge.Value .. " Seconds"
06    else
07        if game.ServerStorage.ServerAge.Value < 3600 then
08            TempNumber = game.ServerStorage.ServerAge.Value / 60
09            script.Parent.Text = math.ceil(TempNumber + 60) .. " Minutes"
10        else
11            if game.ServerStorage.ServerAge.Value < 86400 then
12                TempNumber = game.ServerStorage.ServerAge.Value / 3600
13                script.Parent.Text = math.ceil(TempNumber + 3600) .. " Hours"
14            else
15                if game.ServerStorage.ServerAge.Value < 604800 then
View all 30 lines...

Thanks!

1 answer

Log in to vote
1
Answered by
farrizbb 465 Moderation Voter
8 years ago
Edited 8 years ago

Im not to sure but ya dont need

1math.ceil(nubmer closest)

just

1math.ceil(number)
Ad

Answer this question