How to make value in TextLable 1000 to 1K 2000 to 2K etc and 1000000 to 1M 2000000 to 2M etc and the same for Billion and trillion

This is my script its a local script

while true do

wait(0.1)

local player = game.Players.LocalPlayer

local leaderstats = player:WaitForChild("leaderstats2")

local Score = leaderstats:WaitForChild("Score")

script.Parent.Text = "Score : " .. Score.Value

Score.Value += 1

end

Get the length of the number using #
example -

local Number = 444 ;
local LengthOfNumber = #Number ; --> 3

Then convert the number to string using the tostring function.
example -
tostring(Number) ;

Use string functions such as sub to cut of the excess part and use conditionals to determine whether to put k or M or B .

1 Like

I believe this is what you’re looking for.

https://devforum.roblox.com/t/most-efficient-way-of-converting-a-number-in-scientific-notation-into-a-suffix-and-back/178431/2

1 Like

There are a multiplicity of resources on this. Remember to do some research.

This is one of them:

2 Likes