Floats getting big REALLY FAST

i dont know how to put it but… its kinda self explanatory, its only supposed to step by 0.1 but its having these really big numbers with really small imperfections

image

task.spawn(function()
					local initialTime = 1
					for i = 1, 0, -0.1 do
						wait(0.1)
						initialTime = initialTime - 0.1
						cooldownGUI.TextLabel.Text = tostring("cooldown: " .. initialTime)
					end
				end)

sorry if you cant understand what im saying, im just REALLY tired but the images are self explanatory and speak for themselves

1 Like

Try using math.round() to your advantage. All you have to do is this: math.round(i * 10) / 10, which should keep the decimal place of your numbers, while not getting float numbers

task.spawn(function()
	for i = 1, 0, -0.1 do
		wait(0.1)
		
		local CooldownNumber = math.round(i * 10) / 10
		
		cooldownGUI.TextLabel.Text = tostring("cooldown: " ..CooldownNumber)
	end
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.