SHARE
TWEET

Untitled

a guest Oct 18th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var bytesToSize = function (a, b) {
  2.     if (0 === a) return "0 Bytes";
  3.     var c = 1024, d = b || 2, e = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
  4.         f = Math.floor(Math.log(a) / Math.log(c));
  5.     return parseFloat((a / Math.pow(c, f)).toFixed(d)) + " " + e[f]
  6. }
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