Long ago I had figured out a solution but I've now lost it and I'm looking for it again --
The above solution only shortens it as so -
60.00% | 3000K / 5000K
I would prefer it to start shortening at 1000000 as so -
60.00% | 3.0M / 5.0M
5.00% | 250000 / 5.0M
Thanks for any help!
Edit:
Lua Code:
function(unit, cache, textframe)
local curhp, maxhp
if UnitExists(unit) then
curhp = UnitHealth(unit)
maxhp = UnitHealthMax(unit)
else
curhp = UnitHealth("player")
maxhp = UnitHealthMax("player")
end
local perchp = 100 * curhp/maxhp
local stamp = "%.2f%%".." | "..curhp.." / "..maxhp
return stamp,perchp
end
Current code I'm using.