Hey, I'm using weakaura (2) and want to make a text that shows me the health of myself and another that shows the health of my target (two different texts).
This is what I've been able to with my very, very, very small amount of knowlegde of LUA and some good time spend searching the internet.
Code:
function()
local percent = (UnitHealth("target")/UnitHealthMax("target"))*100
return ("%i"):format(percent)
end
So this returns me, the health of my target as "100%/99%/98%/..." and so forth. But, I want it to show me more decimals like "100.0%/99.9%/99.8%/99.7%/..." and so on.
PS: Sorry if this have been asked before, tried my best using the search functions on the official forum and on here. (:
EDIT: I made it work with
Code:
function()
local percent = (UnitHealth("target")/UnitHealthMax("target"))*100
return ("%.01f"):format(percent)
end
I switched "%i" with "%.01f"