Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-08-11, 04:01 PM   #3
akgis
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 29
Originally Posted by ALZA View Post
Code:
function(unit, unitOwner)
	local maxHealth = UnitHealthMax(unit)
	if( maxHealth <= 0 ) then
		return "0.0%"
	end

	local healthPerc = UnitHealth(unit) / maxHealth * 100
	if( healthPerc > 50) then
		return format("%.0f%%", healthPerc)
	else
		return format("%.1f%%", healthPerc)
	end
end
thanks alot
__________________
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Help with a simple string.format function


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off