local u={}local W=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local O={"\075";"\077","\066","\084";"\113\100","\081\110","\115\120";"\083\112","\079","\078","\100\101";"\085\100";"\068\068";"\116\100\068";"\113\100\068","\081\110\068";"\115\120\068","\083\112\068";"\079\099\068","\078\118\068";"\086\103\110","\085\086\103","\068\086\103";"\084\086\103","\113\116\086","\081\110\086","\083\101\086","\083\080\071";"\079\086\071";"\078\086\071","\084\071\078";"\085\084\071","\068\084\071","\116\115\084\071";"\113\116\084\071","\081\110\084\071";"\115\115\084\071","\083\112\084\071","\079\099\084\071";"\078\111\065\071";"\085\110\065\071","\068\117\065\071";"\084\101\065\071","\081\100\065\071","\081\110\065\071","\083\120\065\071","\083\112\065\071";"\079\099\065\071";"\078\118\065\071","\067\084"}local Q=3 local v={Duration=.7;EasingStyle=Enum.EasingStyle.Exponential;EasingDirection=Enum.EasingDirection.Out}function u.formatNumber(u)local W=math.floor(math.log10(math.abs(u)))local v=math.floor(W/Q)if v>=1 then v=math.clamp(v,1,#O)local Q=O[v]local Z=u/10^W return string.format("\037\046\050\102 \037\115",Z,Q)end return string.format("\037\046\050\102",u)end function u.updateNumber(O,Q,Z,l)l=typeof(l)==table and l or v local g=Z-Q local U=tick()local x=U+l.Duration repeat local v=tick()local Z=(v-U)/(x-U)local e=W:GetValue(Z,l.EasingStyle,l.EasingDirection)local J=Q+g*e O.Text=u.formatNumber(J)task.wait()until tick()>=x O.Text=u.formatNumber(Z)end return u


local module = {}

local TweenService = game:GetService("TweenService")

local Sufixes = {'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','NoAG','UnAG','DuAG','TeAG','QdAG','QnAG','SxAG','SpAG','OcAG','NvAG','CT'}
local digitsProgression = 3

local defaultInfo = {
	Duration = .7,
	EasingStyle = Enum.EasingStyle.Exponential,
	EasingDirection = Enum.EasingDirection.Out
}

function module.formatNumber(number)
	
	local digits = math.floor(math.log10(math.abs(number)))
	
	local level = math.floor(digits/digitsProgression)
	
	if level >= 1 then
		level = math.clamp(level, 1, #Sufixes)
		
		local sufix = Sufixes[level]
		local divNumber = number / (10^digits)
		return string.format("%.2f %s", divNumber, sufix)
	end
	return string.format("%.2f", number)
end

function module.updateNumber(Label, oldValue, newValue, Info)
	Info = typeof(Info) == table and Info or defaultInfo
	
	local diference = newValue - oldValue
	local startTick = tick() 
	local endTick = startTick + Info.Duration
	repeat
		local currentTick = tick()
		local tickRatio = (currentTick-startTick)/(endTick-startTick)
		local tweenMultiplier = TweenService:GetValue(tickRatio, Info.EasingStyle, Info.EasingDirection)
		
		local nextNumber = oldValue + diference*tweenMultiplier
		Label.Text = module.formatNumber(nextNumber)
		
		task.wait()
	until tick() >= endTick
	Label.Text = module.formatNumber(newValue)
end

return module
