I saw this script and been using it ever since. Hopefully this helps:
local Suffixes = {"K","M","B","T","Qd","Qn","Sx","Sp","O","N","De","Ud","DD","TdD","QdD","QnD","SxD","SpD","OcD","NvD","Vgn","UVg","DVg","TVg","QtV","QnV","SeV","SPG","OVG","NVG","TGN","UTG","DTG","tsTG","qtTG","QnTG","ssTG","SpTG","OcTG","NoTG","QdDR","uQDR","dQDR","tQDR","qdQDR","QnQDR","sxQDR","SpQDR","OQDDr","NQDDr","qQGNT","uQGNT","dQGNT","tQGNT","qdQGNT","QnQGNT","sxQGNT","SpQGNT", "OQQGNT","NQQGNT","SXGNTL"}
function Convert(Input)
local Negative = Input < 0
Input = math.abs(Input)
local Paired = false
for i,v in pairs(Suffixes) do
if not (Input >= 10^(3*i)) then
Input = Input / 10^(3*(i-1))
local isComplex = (string.find(tostring(Input),".") and string.sub(tostring(Input),4,4) ~= ".")
Input = string.sub(tostring(Input),1,(isComplex and 4) or 3) .. (Suffixes[i-1] or "")
Paired = true
break;
end
end
if not Paired then
local Rounded = math.floor(Input)
Input = tostring(Rounded)
end
if Negative then
return "-"..Input
end
return Input
end