I have a game and I want the number to be 1.5M instead of 1500000. I don't want to put commas in because that maxes out a 1 Quadrillion so I want to use letters after the numbers. If my explaining is horrible, thats what my irl friends say, then I mean just like case clicker
Would this work?
local value = script.Parent.Text function changeNumber(int) if tonumber(int) > 1000 then int.Text = 1K --// Other stuff end while true do changeNumber(value) wait(1) end
Tested and functional; Lengthen the shorten function (haha) to add more values, and update "money" with whatever you desire. Shortens to 1 decimal place.
local money = 0; -- update this value by whatever means local text = script.Parent.Text; local shorten = function(number) if(number > 1000 and number < 1000000)then return tostring(math.floor(number/10^2)/10) .. "k"; elseif(number > 1000000 and number < 1000000000)then return tostring(math.floor(number/10^5)/10) .. "m"; elseif(number > 10^9 and number < 10^12)then return tostring(math.floor(number/10^8)/10) .. "b"; -- ... update with more ifs here end end while wait() do text = shorten(money); end
You'll need a way to keep track of the actual cash for it wont get lost so just change "Cash" to where you want/are keeping it.
local value = script.Parent.Text local Cash = 50012--Whatever the cash value is function changeNumber(int) if tonumber(Cash) > 1000 then print(tostring( Cash/1000 .."k")) end end while true do changeNumber(value) wait(1) end