Sometimes decimals doesn’t show what they are supposed to (example: 1.1 + 1.2 = 2.29) so that needs to be rounded (only below 1000). But the numbers above 1000 should abbreviate. I got a script with 2 functions, 1 for abbreviating the numbers and 1 for rounding them. But I can’t seem to combine the two together.
Abbreviate:
local u1 = { "", "K", "M", "B", "T", "Qd", "Qn", "Sx", "Sp", "Oc", "No", "De", "UDe", "DDe", "TDe", "QdDe", "QnDe", "SxDe", "SpDe", "OcDe", "NoDe", "Vgn", "UVg", "DVg", "TVg", "qtV", "QnV", "SeV", "SPG", "OVG", "NVG", "TGN", "UTG", "DTG", "tsTG", "qtTG", "QnTG", "ssTG", "SpTG", "OcTG", "NoAG", "UnAG", "DuAG", "TeAG", "QdAG", "QnAG", "SxAG", "SpAG", "OcAG", "NvAG", "CT" };
local function v1(p1)
for v2 = 1, #u1 do
if tonumber(p1) < 10 ^ (v2 * 3) then
return math.floor(p1 / (10 ^ ((v2 - 1) * 3) / 100)) / 100 .. u1[v2];
end;
end;
end;
Round:
local function math_round(n: number, scale: number?)
return tonumber(string.format("%." .. (typeof(scale) == "number" and scale or 2) .. "f", n))
end
while true do
wait()
script.Parent.Text = "Points: "..v1(player.Stats.Points.Value)
end