The script is supposed to round a number to the nearest hundredths place. However, it rounds to a whole number, and sometimes that whole number is incorrect.
Can someone please help me?
Here's the code:
local Player = game.Players.LocalPlayer local Stats = Player.leaderstats while wait(0.1) do if Player ~= nil then if Stats ~= nil then local Number = math.floor((Stats.Kills.Value/math.max(1,Stats.Deaths.Value))) function round(x,near) return math.floor(x/near+.5)*near end wait(0.1) script.Parent.Text = "Ratio: "..round(Number,2).."" end end end
It's rounding to the nearest 2. You want to round to the nearest .01