Try this, may have a performance hit, but shouldn't be too bad
Code:
local cur,max = Power(unit),MaxPower(unit)
if max > 0 then
local p = 100*cur/max
if p%1 >= 0.5 then p = math.ceil(p) else p = math.floor(p) end
return "%s/%s - %s%%",VeryShort(cur,true),VeryShort(max,true),p
end
---------- Post added 2011-04-06 at 03:15 PM ----------
This is what i think gollie meant, but it has a flaw, as in the sub() function will return 4 (or 3 or 2) characters, which means that if you have 94.6%, it'll return "94.6", if you use 3, it'll return "94.", if you use 2, it'll return "94". But if you have 5.66% (for example), it'll still return "5.". So it'd need some logic to pick the right number of decimals, with a special case for 100%.
Code:
local cur,max = Power(unit),MaxPower(unit)
if max > 0 then
return "%s/%s - %s%%",VeryShort(cur,true),VeryShort(max,true),string.sub((cur / max * 100),1,4)
end