The code is working fine however when I tested it I was on stage 1 and the percent indicator looking like this Progress: 0.14285714285714% but I need help on how would I shorten it to 0.14% instead of 0.14285714285714%.
edit: I want it to change the no. removing this 1.00 and making it 1 however I can't understand how to change it basically I want to remove the decimal point if it is a whole no. and if it has a decimal it will automatically have a decimal point
edit2: NVM It works now
local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild("leaderstats")
local Stagelabel = script.Parent.Parent.Stages
local Progresslabel = script.Parent.Parent.Progress
local bar = script.Parent.Bar
local MaxStage = 700
while wait(0.01) do
local Percent = game.Players.LocalPlayer:WaitForChild("leaderstats").Stage.Value / MaxStage * 100
bar.Size = UDim2.new(1/(MaxStage/leaderstats.Stage.Value), 0, 1, 0)
Stagelabel.Text = "Stage: "..game.Players.LocalPlayer:WaitForChild("leaderstats").Stage.Value
for i = 0,100,1 do
if Progresslabel.Text ~= "Progress: "..i..".00%" then
Progresslabel.Text = ("Progress: %.2f%%"):format(Percent)
end
end
for i = 0,100,1 do
if Progresslabel.Text == "Progress: "..i..".00%" then
Progresslabel.Text = ("Progress: %.0f%%"):format(Percent)
end
end
end

1 comment
Use math.floor. That will round it off to the nearest whole number.