Woops, my bad, I left some Pitbull code in my examples
Code:
function(unit)
local pCur, pMax = UnitPower(unit), UnitPowerMax(unit)
if pMax > 0 then
local _, pToken = UnitPowerType(unit)
if pToken == "RAGE" or pToken == "RUNIC_POWER" then
-- Warrior / Teddy Bear Druid / DK
if pCur > 0 then
return "%d", pCur
end
elseif pToken == "ENERGY" then
-- Rogue / Kitty Druid
if pCur < pMax then
return "%d", pCur
end
else
-- Everything else
local pPer = ceil(pCur / pMax)
if pPer < 100 then
return "%d", pPer
end
end
end
end