Skip to content
Create a gist now

Instantly share code, notes, and snippets.

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"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.