FormatFix

FormatFix

9.4k Downloads

shorten hp/mana by k or m

mwonng opened this issue ยท 0 comments

commented

i put a code which might be good or more friendly than AbbreviateLargeNumbers for target, especially for boss hp,hope it would be help.

local function FormatNumber(val)
    if val >= 10^6 then
        return string.format("%.2fm", val / 10^6)
    elseif val >= 10^3 then
        return string.format("%.1fk", val / 10^3)
    else
        return tostring(val)
    end
end