local suffixes = {'','K','M','B','T','qd','qn','sx','Sp','O','N','de'}
local function format(val)
for i=1, #suffixes do
if tonumber(val) < 10^(i*3) then
return math.floor(val/((10^((i-1)*3))/100))/(100)..suffixes[i]
end
end
end

I am not good at explaining at all, and I wont much to bore you with this stuff (I’m in 10 grade still learning math) basically for all of the suffixes, if the (value) is less than 10 to the power of (the suffix # in the list) * 3 then round (value) divided by blablabla divided by 100 and that rounded number divided by 100 gets you the result?
its really late for me, sorry