Your code:
Code:
function(unit, cache, textframe)
if UnitPowerType("player") == 0 then
local z = math.max(0, UnitPower("player")) / math.max(1, UnitPowerMax("player")) * 100;
return string.format("%.f", z) .. "%%";
else
return UnitPower("player")
end
Proper code:
Code:
function(unit, cache, textframe)
if UnitPowerType("player") == 0 then
local z = math.max(0, UnitPower("player")) / math.max(1, UnitPowerMax("player")) * 100;
return string.format("%.f", z) .. "%%";
else
return UnitPower("player")
end
end
Proper indentation helps.