JavaScript Snippet – suffixFileSize()

If you would like to convert the amount of bytes (or bits) into the corresponding measure when the size is a kilobyte or bigger (or a kilobit or bigger) you can use the following JavaScript function: Here are some examples of using it: // Convert bytes console.log(suffixFileSize(1023)); // 1023 B Read more…

By Chris West, ago