Revert "Changed health calculation to have more precision"
Scott King [01-16-14 - 04:10]
Revert "Changed health calculation to have more precision"
This reverts commit db86e676d99d851c67ef240543b86d3634ba793f.
diff --git a/PortraitHealth.lua b/PortraitHealth.lua
index 670ad08..77b16c6 100755
--- a/PortraitHealth.lua
+++ b/PortraitHealth.lua
@@ -31,7 +31,7 @@ end
function HealthPercentage()
-- Health value to display. Whole numbers only.
- TargetPercentHealth = (UnitHealth("target") / UnitHealthMax("target") * 100);
+ TargetPercentHealth = math.ceil((UnitHealth("target") / UnitHealthMax("target") * 100));
-- Class detection
@@ -69,13 +69,12 @@ function HealthPercentage()
PortraitHealth_Health:SetTextColor(1,1,0);
end
- local h = string.format("%.0f",TargetPercentHealth);
-- change the portrait to show current health
if UnitIsDead("target") then
PortraitHealth_Health:SetText('Dead');
else
- PortraitHealth_Health:SetText(h .. '%');
+ PortraitHealth_Health:SetText(TargetPercentHealth .. '%');
end
end