The leaderboard does not display the letters of abbreviations

I made a script for leaderboards, but when, for example, I have 1e30 strength, the leaderboard shows 100 and it should be 1N, that is, it does not write letters, only outputs a number, I do not know how to fix this here is the script

--// GENERAL VARIABLES
local DSS = game:GetService("DataStoreService")
local DataStore = DSS:GetOrderedDataStore("test")
local moduleSc = require(game.ReplicatedStorage.ModulesScript.Abbreviate)

local function ScaleFactor(value)
	local magnitude = math.floor(math.log10(value))
	local scale = 10 ^ (magnitude - 2) 
	return scale
end

--// UI VARIABLES
local UI = script.Parent.SurfaceGui
local basePlayerFrame = UI.BasePlayerFrame
local boardFrame = UI.ScrollingFrame

--// Functions
local function SaveData()
	for _, player in pairs(game:GetService("Players"):GetPlayers()) do
		local plr_key = "id_" .. player.UserId .. "_Strength"
		local Strength = player:FindFirstChild("Strength")
		if Strength and typeof(Strength.Value) == "number" then
			local scale = ScaleFactor(Strength.Value)
			local success, result = pcall(function()
				DataStore:SetAsync(plr_key, math.floor(Strength.Value / scale))
			end)
			if not success then 
				warn(result)
			end
		else
			warn("Strength " .. player.Name)
		end
	end
end

local function getTop10Players()
	local isAscending = false
	local pageSize = 10
	local pages = DataStore:GetSortedAsync(isAscending, pageSize)
	local top10 = pages:GetCurrentPage()
	local top = {}

	for rank, data in ipairs(top10) do
		local dataName = data.key
		local name = game:GetService("Players"):GetNameFromUserIdAsync(dataName:split('_')[2])
		local Strength = data.value
		local scale = ScaleFactor(Strength)
		local currentPlayer = { Player = name, Strength = Strength * scale, Rank = rank }
		table.insert(top, rank, currentPlayer)
	end

	return top
end

local function ClearList()
	task.spawn(function()    
		for _, plrFrame in pairs(boardFrame:GetChildren()) do
			if not plrFrame:IsA("Frame") then continue end
			plrFrame:Destroy()
			task.wait(0.25)
		end
	end)
end

local function UpdateList()
	SaveData()
	ClearList()
	local top50 = getTop10Players()

	task.spawn(function()    
		for _, plr in ipairs(top50) do
			local frame = basePlayerFrame:Clone()
			frame.Parent = boardFrame

			frame.Plr.Text = plr.Player
			frame.Amount.Text = moduleSc.abbreviate(plr.Strength) 
			frame.Rank.Text = plr.Rank

			frame.Visible = true
			task.wait(0.25)
		end
	end)
end

task.spawn(function()
	while true do
		UpdateList()
		for count = 5, 0, -1 do
			script.Parent.Part.SurfaceGui.Count.Text = "Leaderboard Updating In:" .. count .. " seconds!"
			task.wait(1)
		end
	end
end)

and the abbreviate module script

local module = {}
local abvs = {
	"", -- 1-3 might not be so accurate idk i fell asleep while counting
	"K", -- 3
	"M", -- 6
	"B", -- 9
	"T", -- 12
	"Qd", -- 15
	"Qn", -- 18
	"Sx", -- 21
	"Sp", -- 24
	"Oc", -- 27
	"N", -- 30
	"dc", -- 33
	"Ud", -- 36
	"DD", -- 39
	"Td", -- 42
	"QaD", -- 45
	"QiD", -- 48
	"SxD", -- 51
	"SpD", -- 54
	"OcD", -- 57
	"ND", -- 60
	"Vgn", -- 63
	"UVg", -- 66
	"DVg", -- 69
	"TVg", -- 72
	"qaV", -- 75
	"QnV", -- 78
	"SxVg", -- 81
	"SpVg", -- 84
	"OCVG", -- 87
	"NVG", -- 90
	"TGN", -- 93
	"UTG", -- 96
	"DTG", -- 99
	"tsTG", -- 102
	"qtTG", -- 105
	"QnTG", -- 108
	"ssTG", -- 111
	"SpTG", -- 114
	"OcTG", -- 117
	"NoAG", -- 120
	"UnAG", -- 123
	"DuAG", -- 126
	"TeAG", -- 129
	"QdAG", -- 132
	"QnAG", -- 135
	"SxAG", -- 138
	"SpAG", -- 141
	"OcAG", -- 144
	"NvAG", -- 147
	"CT", -- 150
	"TaCG", -- 153
	"AnTG", -- 156
	"YX", -- 159
	"YaZQ", -- 162
	"YXZ", -- 165
	"NoEV", -- 168
	"KoTG", -- 171
	"TrAG", -- 174 dont know any more abbreviation so it become E
	"e178",  -- 177
	"e181", -- 180
	"e184", -- 183
	"e187", -- 186
	"e190", -- 189
	"e193", -- 192
	"e196", -- 195
	"e199", -- 198

	"∞"; -- infonate
}

module.abbreviate = function(number)
	for i =1, #abvs do
		if number < 10 ^ (i * 3) then
			if abvs[i] == "∞" then
				return "∞"
			else
				return math.floor(number / ((10 ^ ((i-1) * 3)) / 100)) / (100)..abvs[i]
			end
		elseif tostring(number) == "inf" then
			return "∞"
		end
	end
end
return module

I tried to change the script but nothing worked it’s still relevant any help is appreciated

Please help me good people, I don’t understand how to solve the problem

This is still relevant, please help me figure out what the problem is.

When testing the abbreviation function in isolation, it seems to work correctly.

Can you please add a few print statements throughout your script, to try and figure out where the issue is occuring, including:

  • print(number) on the first line of the abbreviate function
  • print(Strength) after line 46
  • print(scale) after line 47

Hello, I found out what the problem is, it turns out the problem is in this script, it does not allow you to show letters with an abbreviation

I brought out the prints after the script that I wrote at the top and through the print it shows, I understood that the problem is in this side of the script