FIXED
sorry if the title is confusing, but basically my numbervalue keeps going to values like 1.5000000000001 and such, and it’s really annoying. what im doing is im just adding 0.01 points every 1/100 of a second, i don’t know why this happens
as you can see this is annoying as heck
local currentValue = baseValue / 100 -- 0.01
for _, multi in pairs(gains[statName]) do -- theres no multis
currentValue *= multi
end
currencies[statName].Value = zephyrMath.AdvRound(currencies[statName].Value + currentValue, 0.01) -- my rounding function (didnt work without it too)
function funcs.AdvRound(value : number, increment : number, bias : number)
-- For example, pretend value = 260, increment = 50, and bias = 0 --
local cycles = value / increment -- Ex. 260 / 50 = 5.1
if bias == 0 then -- Round Down
cycles = math.floor(cycles) -- Ex. 5.1 >> 5
elseif bias == 1 then -- Round Up
cycles = math.ceil(cycles)
else -- Round Normally
cycles = math.round(cycles)
end
-- Get Result
local result = cycles * increment -- Ex: 50 x 5 = 250 (250 is the closest multiple of increment 50 to 260)
return result
end
im using number values to display decimals such as 1.52, but i do not want 1.00000000000001 being shown to my players