Help with formatting text

How would I go about formatting text, like turning “12,500” into “12.5K?”

local Input = 1321312312

	if Input < 1e6 and Input >= 1e3 then
		local text  = tostring(Input/1e3):sub(1,5) .. "K"
			
	elseif Input < 1e9 and Input >= 1e6 then
		local text  = tostring(Input/1e6):sub(1,5) .. "M"
        end

you can use something like this

1 Like

there are some public resources on that

https://devforum.roblox.com/search?q=number%20suffix%20%23resources:community-resources

1 Like