I'm trying to calculate the time remaining for a specific debuff. I'm not getting any errors but I think my lack of lua Math and Rounding is causing a nonsensical return.
Given:
Code:
local function getSpellTime(spell)
local name, _, _, _, _, dur, exp, caster = UnitDebuff("target", spell)
if name ~= nil and caster == "player" and name == spell then
return exp - GetTime();
end
end
My return value is usually something like 2... or 4...
Any idea what I need to get whole second times?