Skip to content

Commit e8e7a3a

Browse files
committed
Merge pull request #31 from avoidwork/edge
Minor change
2 parents 1e89e84 + 642966b commit e8e7a3a

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

lib/filesize.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @license BSD-3 <https://raw.github.com/avoidwork/filesize.js/master/LICENSE>
77
* @link http://filesizejs.com
88
* @module filesize
9-
* @version 1.9.2
9+
* @version 1.9.3
1010
*/
1111
( function ( global ) {
1212
"use strict";
@@ -30,11 +30,10 @@
3030
/**
3131
* filesize
3232
*
33-
* @param {Mixed} arg String, Int or Float to transform
34-
* @param {Number} pos [Optional] Position to round to, defaults to 2 if short is ommitted
35-
* @param {Boolean} short [Optional] Shorthand output, similar to "ls -lh", overrides pos to 1
36-
* @param {Boolean} bits [Optional] Determines if `bit` sizes are used for result calculation, default is true
37-
* @return {String} Readable file size String
33+
* @param {Mixed} arg String, Int or Float to transform
34+
* @param {Mixed} pos [Optional] Position to round to, defaults to 2 if short is ommitted, or `true` for shorthand output
35+
* @param {Boolean} bits [Optional] Determines if `bit` sizes are used for result calculation, default is true
36+
* @return {String} Readable file size String
3837
*/
3938
function filesize (arg) {
4039
var result = "",
@@ -73,7 +72,7 @@
7372

7473
// Zero is now a special case because bytes divide by 1
7574
if ( num === 0 ) {
76-
result = Number( 0 ).toFixed( 0 ) + "B";
75+
result = "0B";
7776
}
7877
else {
7978
if ( bits ) {

lib/filesize.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "filesize",
33
"description": "JavaScript library to generate a human readable String describing the file size",
4-
"version": "1.9.2",
4+
"version": "1.9.3",
55
"homepage": "http://filesizejs.com",
66
"author": {
77
"name": "Jason Mulligan",

src/filesize.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
/**
2121
* filesize
2222
*
23-
* @param {Mixed} arg String, Int or Float to transform
24-
* @param {Number} pos [Optional] Position to round to, defaults to 2 if short is ommitted
25-
* @param {Boolean} short [Optional] Shorthand output, similar to "ls -lh", overrides pos to 1
26-
* @param {Boolean} bits [Optional] Determines if `bit` sizes are used for result calculation, default is true
27-
* @return {String} Readable file size String
23+
* @param {Mixed} arg String, Int or Float to transform
24+
* @param {Mixed} pos [Optional] Position to round to, defaults to 2 if short is ommitted, or `true` for shorthand output
25+
* @param {Boolean} bits [Optional] Determines if `bit` sizes are used for result calculation, default is true
26+
* @return {String} Readable file size String
2827
*/
2928
function filesize (arg) {
3029
var result = "",
@@ -63,7 +62,7 @@
6362

6463
// Zero is now a special case because bytes divide by 1
6564
if ( num === 0 ) {
66-
result = Number( 0 ).toFixed( 0 ) + "B";
65+
result = "0B";
6766
}
6867
else {
6968
if ( bits ) {

0 commit comments

Comments
 (0)