I would like to personalize this Shadowed Unit frames function to only show decimal percentage 100.0% if the Unit is under 50%. Example Unit is 100% hp then shows at 100%, unit is under 50% then show 38.7%
function(unit, unitOwner)
local maxHealth = UnitHealthMax(unit)
if( maxHealth <= 0 ) then
return "0.0%"
end
return string.format("%.1f%%", (UnitHealth(unit) / maxHealth) * 100)
end
|