Commit f89c9011 authored by Mihkel Putrinš's avatar Mihkel Putrinš

===

parent 397e497d
var bytesToSize = function bytesToSize(bytes) { var bytesToSize = function bytesToSize(bytes) {
if (bytes === undefined) bytes = 0 if (bytes === undefined) bytes = 0
var sizes = ['B', 'KB', 'MB', 'GB', 'TB'] var sizes = ['B', 'KB', 'MB', 'GB', 'TB']
if (bytes == 0) return '0 B' if (bytes === 0) return '0 B'
try { try {
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))) var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)))
var decimals = Math.max(0, i-1) var decimals = Math.max(0, i-1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment