daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. -- Format Number Value
  3. local function FormatValue(val)
  4.     if (not cfg.barsCondenseValues) then return val end
  5.    
  6.     local fmt
  7.     if val >= 10000000 or val <= -10000000 then
  8.         fmt = "%.1fm"
  9.         val = val / 1000000
  10.     elseif val >= 1000000 or val <= -1000000 then
  11.         fmt = "%.1fm"
  12.         val = val / 1000000
  13.     elseif val >= 100000 or val <= -100000 then
  14.         fmt = "%.0fk"
  15.         val = val / 1000
  16.     elseif val >= 1000 or val <= -1000 then
  17.         fmt = "%.1fk"
  18.         val = val / 1000
  19.     else
  20.         fmt = "%d"
  21.         val = math.floor(val+0.5)
  22.     end
  23.    
  24.     return fmt:format(val)
  25. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top