In short my problem is that I need a value to display on a surface GUI and add +0.05 every time a button is clicked, it works fine except for the fact that it will often display the value as something like 0.4000000000001, despite the number value that’s being added just being 0.05. I want it to just display any number from the hundreds decimal place and up only.
I have looked around and haven’t found any helpful answers and have very little scripting knowledge so any help would be appreciated.
That was just an example. Using the code you shared earlier:
local UpgValue = script.Parent.UpgraderInfo.UpgradeValue
local ClkValue = script.Parent.UpgraderInfo.ClickValue
script.Parent.ClickDetector.MouseClick:Connect(function(click)
if click then
UpgValue.Value = math.round((UpgValue.Value + ClkValue.Value) * 100) / 100
end
end)