View Single Post
11-18-15, 06:35 PM   #7
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote