Create abbreviation script

Hello everyone, I created a script that when you buy from you, the boost and the cost of the next class are written, but here I can not make the abbreviation my script

local tp = player["TotalPower"]
local class = player.Class 
local name = script.Parent.Parent.ClassNameText
local reset = game.ReplicatedStorage.ResetStats
local setClass = game.ReplicatedStorage.AddStat
local selectedClass
local accepted = {"F-Class", "E-Class", "D-Class", "C-Class", "B-Class", "A-Class", "S-Class", "SS-Class", "SSS-Class", "X-Class", "Y-Class", "Z-Class", "XYZ-Class" }
local boosts = {["F-Class"]=2, ["E-Class"]=5, ["D-Class"]= 20, ["C-Class"]= 100, ["B-Class"]=500, ["A-Class"]=2500, ["S-Class"]=12500, ["SS-Class"]=150000, ["SSS-Class"]=1500000, ["X-Class"]=30000000, ["Y-Class"]=1000000000, ["Z-Class"]=40000000000, ["XYZ-Class"]=400000000000}  --e3=000, 1e3 = 1000, 10e3 = 10000
local tpNeeded = {["F-Class"]=1000000, ["E-Class"]=100000000, ["D-Class"]=20000000000, ["C-Class"]=3990000000000, ["B-Class"]=5000000000000000, ["A-Class"]=99000000000000000000,["S-Class"]=100000000000000000000000,["SS-Class"]=4990000000000000000000000000,["SSS-Class"]=10000000000000000000000000000000000,["X-Class"]= 50000000000000000000000000000000000000000,["Y-Class"]=100000000000000000000000000000000000000000000,["Z-Class"]=10000000000000000000000000000000000000000000000,["XYZ-Class"]=24800000000000000000000000000000000000000000000000   } --total power needed
local desc = script.Parent.Parent.Desc
local NameText = script.Parent.Parent.NameText
local price = script.Parent.Parent.PriceText
local boost = script.Parent.Parent.BoostText
local classname = script.Parent.Parent.ClassNameText

script.Parent.MouseButton1Click:Connect(function()
	local Class_Number = table.find(accepted, tostring(class.Value))
	
	selectedClass = 'F-Class'

	if Class_Number ~= nil then
		selectedClass = accepted[Class_Number + 1]
	end
	
	if selectedClass and class.Value ~= selectedClass then
		local needed = tpNeeded[selectedClass]
		price.Text = needed
		if tp.Value >= needed then
			setClass:FireServer("Class", selectedClass, "set")
			reset:FireServer()
			
			name.Text = selectedClass
			classname.Text = selectedClass
			boost.Text = `boost: {boosts[selectedClass]}`
		end
	else
		-- You bought all classes
	end
end)

name.Text = class.Value

guys help to do please this is very necessary

Can you give me some more context? What do you mean by abbreviation and where is the code snippet that makes this “abbreviation.”

My cost is written 2000000000, and the player does not understand how much he needs, just look at the price and boost

I guess you mean that’s right? I just wanted to make a reduction

Well where do you think you should start? Hint: Loops.

I honestly don’t understand how to make an abbreviation myself and cycles I forgot

Can you help make the abbreviation huh?

Well the first step would be to find which abbreviation to use, how would you do that?

I have an abbreviation in replicated storage

local suffixes = {"","K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","De","Ud"}
function Convert(num,n)
    if num == math.huge then return "inf" end
    for i = 1, #suffixes do
        if tonumber(num) < 10 ^ (i * 3) then
            newnum = num / 10^((i-1)*3)
            return  string.format("%."..n.."f",newnum)..suffixes[i]
        end
    end
end

I’ve created a script, what should I do next?

Well, where do you call the function?

I don’t know how to cause it Can you help?