We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/* --- description: Utility method to format bytes into the most logical magnitude (KB, MB, or GB). authors: - Jean-Nicolas Boulay (http://jean-nicolas.com/) license: - MIT-style license requires: - core/1.4 provides: - Number.formatBytes ... */ Number.implement({ formatBytes: function(showUnit, toFixed) { var units = (typeOf(showUnit) == 'array' && showUnit.length == 9)?showUnit:['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], showUnit = (typeOf(showUnit) == 'null')?true:false, toFixed = (typeOf(toFixed) == 'null')?2:toFixed, bytes = this, i; for (i = 0; bytes >= 1024 && i < 8; i++) { bytes /= 1024; } var unit = (showUnit)?units[i]:''; return bytes.toFixed(toFixed) + unit; } });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: