public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7
if (fileSize < 1024) {
response = parseFloat(fileSize).toFixed(2) + " bytes"
} else if (fileSize < 1048576) {
response = (parseFloat(fileSize)/1024).toFixed(2) + " KB"
} else {
response = (parseFloat(fileSize)/1048576).toFixed(2) + " MB"
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.