Hello everyone! I came across a moment when the numbers in the Label are too many and they need to be rounded to thousands, millions, billions and so on.
(the main question)
How to make a rounding function up to thousands (and so on)
Here is the script(if of course you need it for):
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
local remoteEvent = ReplicatedStorage:WaitForChild("GuiLoader"):WaitForChild("RemoteEventDislike")
local Dislikes = player:WaitForChild("leaderstats"):WaitForChild("Dislikes")
local Rebirths = player:WaitForChild("leaderstats"):WaitForChild("Rebirths")
local Button = player:WaitForChild("PlayerGui"):WaitForChild("DefoltClick"):WaitForChild("ClickButton")
local GuiDis = player:WaitForChild("PlayerGui"):WaitForChild("DefoltClick"):WaitForChild("Dislike")
local GuiMDis = player:WaitForChild("PlayerGui"):WaitForChild("DefoltClick"):WaitForChild("MultiDislike")
local function use ()
wait(0.1)
Dislikes.Value+= Rebirths.Value
end
GuiDis.Text = Dislikes.Value
GuiMDis.Text = "X"..Rebirths.Value
Button.Activated:Connect(use)
remoteEvent.OnClientEvent:Connect(use)