Here you go. I also future-proofed it by formatting higher numbers, if you ever run into that.
Lua Code:
local function FormatValue(val)
if val<1000 then return ("%.0f"):format(val)
elseif val<1000000 then return ("%.1fk"):format(val/1000)
elseif val<1000000000 then return ("%.1fm"):format(val/1000000)
elseif val<1000000000000 then return ("%.1fb"):format(val/1000000000)
else return ("%.1ft"):format(val/1000000000000) end
end
hooksecurefunc("CompactUnitFrame_UpdateStatusText",function(self)
if self.optionTable.healthText=="health" and tonumber(self.statusText:GetText() or "") then
local hp=UnitHealth(self.displayedUnit)
local maxhp=UnitHealthMax(self.displayedUnit)
self.statusText:SetText(format("%d%% %s",hp*100/maxhp,FormatValue(hp)))
self.statusText:SetTextColor(0.9,0.9,0.9,1)
if not self.smallStatus then
self.statusText:SetFont("Fonts\\ARIALN.TTF",14,"THINOUTLINE")
self.smallStatus=false
end
end
end)