Guest User

Untitled

a guest
Jul 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. -- Memory Usage
  2. local formatMemory = function(bytes)
  3. bytes = bytes * 1024
  4.  
  5. local s = {'B', 'Kb', 'MB', 'GB', 'TB'}
  6. local e = floor(abs(log(bytes+1)/log(1024)))
  7.  
  8. return format("%.1f "..s[e+1], (bytes/1024^e))
  9. end
Add Comment
Please, Sign In to add comment