Created
August 15, 2014 19:25
-
-
Save nefftd/0c2f2d52bceb12099aba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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