I need to make an abbreviation of numbers in leaderstats

Hello community, this script is an abbreviation of numbers but it does not work for me who can help me?

script - “ServerScriptService”:

  local T = {"K","M","B","T","q","Q","s","S","O","N","d","U","D"}

    local function formatNumber(n)

    if not tonumber(n) then return n end

    if n < 10000 then return math.floor(n) end

    local d = math.floor(math.log10(n)/3)*3

    local s = tostring(n/(10^d)):sub(1,5)

    return s.." "..tostring(T[math.floor(d/3)])

    end 

please help, i the need :frowning:

You never actually called the formatNumber function

local T = {"K","M","B","T","q","Q","s","S","O","N","d","U","D"}

local function formatNumber(n)
	if not tonumber(n) then return n end
	if n < 10000 then return math.floor(n) end
	local d = math.floor(math.log10(n)/3)*3
	local s = tostring(n/(10^d)):sub(1,5)
	return s.." "..tostring(T[math.floor(d/3)])
end 

print(formatNumber(95000000))

-- > 95 M

What would you call it, as you put it or as bro?

You never ran the actual formatNumber function, as you can see I added a line that prints the formatted number of 95,000,000

print(formatNumber(95000000))

mmmm its dont work, bro :frowning: