Explain how to make suffixes for numbers please

Hello! I was looking for a script that shorten numbers, but they do not work.I do not understand how to make this system, but I think that the system should be in this script.

I have a local script that gives points.

local Point = Instance.new("IntValue")
Point.Name ="Point"
Point.Value = 0
Point.Parent = script.Parent

script.Parent.MouseMoved:Connect(function()
	Point.Value += 1
	game.Players.LocalPlayer.PlayerGui.ScreenGui.Change.Text = Point.Value
	
end)

local Delete = game.Players.LocalPlayer.PlayerGui.ScreenGui.Delete

Delete.MouseButton1Click:Connect(function()
	Point.Value = 0
	game.Players.LocalPlayer.PlayerGui.ScreenGui.Change.Text = Point.Value
end)

I hope I explained my problem in detail. Good luck and bye!

Did you try searching for similar topics? This has been covered many times already.

I searched, but nothing worked.

What do you mean by “shorten” numbers? Do you mean round them?

You can use math.floor(), math.ceil(), math.round() to achieve this.

1 Like

These old topics come up just searching for “suffix”:

What have you tried so far and how didn’t it do what you want?

The basic idea is to use math.log math to get the base 10 logarithm of the number, which tells you how many digits are in the number. You then floor that number and look through a table to see which metric prefix fits best. Then divide the number by the size of the prefix and add the relevant prefix/suffix.

1 Like

How do I get this to work? I have a text that changes to a number when I move the mouse over a gui.
I found one script, but I don’t understand how to make it work.

Okay, I think I don’t need it.Thanks for the help.

1 Like