Is there any way to estimate a number using arithmetic?

I’m making a game that measures your CPS (Clicks Per Second). Everything is going well, but I found something I want to change, which is estimating, or rounding, to make it an integer.

I have done my research but just can’t find anything about the topic.

Here is an image showing the amount of CPS:

Also, here is my script:

local cps = script.Parent.TextLabel
local button = script.Parent.TextButton
local start = script.Parent.Start

start.MouseButton1Click:Connect(function()
	print("3")
	wait(1)
	print("2")
	wait(1)
	print("1")
	wait(1)
	print("CLICK!")
	
	for count = 1, 4, 1 do
		button.MouseButton1Click:Connect(function()
			button.TextLabel.Text = button.TextLabel.Text + 1/3
		end)
	end
	
	wait(3)
	
	button.TextLabel.Text = button.TextLabel.Text / 3
	cps.Text = button.TextLabel.Text
	
	game.Players.LocalPlayer:Kick("You have got a total CPS of "..cps.Text.."! Rejoin if you want to test again.")
end)

Thank you for taking the time to read the current problem I’m having!

you can also use string.format since you are printing it out/using it as a text which is important for “string” types like text:

Or, There’s this method which works with “numbers” type value,

Thank you, let me see if this works!

local cps = script.Parent.TextLabel
local button = script.Parent.TextButton
local start = script.Parent.Start

local decimalPlaces = 0 -- Any number between 0 and 2

start.MouseButton1Click:Connect(function()
	print("3")
	wait(1)
	print("2")
	wait(1)
	print("1")
	wait(1)
	print("CLICK!")
	
	for count = 1, 4, 1 do
		button.MouseButton1Click:Connect(function()
			button.TextLabel.Text = button.TextLabel.Text + 1/3
		end)
	end
	
	wait(3)
	
	button.TextLabel.Text = button.TextLabel.Text / 3



        local Clicks =  button.TextLabel.Text
        Clicks*= 10^decimalPlaces
        Clicks+=0.5
        Clicks = math.floor(clicks)
        Clicks /= 10^decimalPlaces
        cps.Text = Clicks
	
   
	game.Players.LocalPlayer:Kick("You have got a total CPS of "..cps.Text.."! Rejoin if you want to test again.")
end)
math.floor(tonumber(cps.Text) * 10) / 10