Skip to content

Instantly share code, notes, and snippets.

@nefftd
Created August 15, 2014 19:25
Show Gist options
  • Save nefftd/0c2f2d52bceb12099aba to your computer and use it in GitHub Desktop.
Save nefftd/0c2f2d52bceb12099aba to your computer and use it in GitHub Desktop.
function plateAPI:update_health(current,max)
local text = (
current > 999999 and ('%.1fM'):format(current/1000000) or
current > 99999 and ('%dk') :format(current/1000) or
current > 9999 and ('%.1fk'):format(current/1000) or
('%d'):format(current)
)
self.hptext:SetText(text)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment