Comparing version 2.0.3 to 2.0.4
@@ -9,3 +9,3 @@ /** | ||
* @module filesize | ||
* @version 2.0.3 | ||
* @version 2.0.4 | ||
*/ | ||
@@ -31,2 +31,3 @@ ( function ( global ) { | ||
skip = false, | ||
val = 0, | ||
e, base, bits, ceil, neg, num, round, unix, spacer, suffix, z, suffixes; | ||
@@ -69,18 +70,18 @@ | ||
if ( e > 8 ) { | ||
result = result * ( 1000 * ( e - 8 ) ); | ||
e = 8; | ||
val = val * ( 1000 * ( e - 8 ) ); | ||
e = 8; | ||
} | ||
if ( base === 2 ) { | ||
result = num / Math.pow( 2, ( e * 10 ) ); | ||
val = num / Math.pow( 2, ( e * 10 ) ); | ||
} | ||
else { | ||
result = num / Math.pow( 1000, e ); | ||
val = num / Math.pow( 1000, e ); | ||
} | ||
if ( bits ) { | ||
result = ( result * 8 ); | ||
val = ( val * 8 ); | ||
if ( result > ceil ) { | ||
result = result / ceil; | ||
if ( val > ceil ) { | ||
val = val / ceil; | ||
e++; | ||
@@ -90,3 +91,3 @@ } | ||
result = result.toFixed( e > 0 ? round : 0 ); | ||
result = val.toFixed( e > 0 ? round : 0 ); | ||
suffix = si[bits ? "bits" : "bytes"][e]; | ||
@@ -110,3 +111,3 @@ | ||
if ( zero.test( z ) ) { | ||
result = parseInt( result, radix ); | ||
result = parseInt( result, radix ).toString(); | ||
} | ||
@@ -113,0 +114,0 @@ |
{ | ||
"name": "filesize", | ||
"description": "JavaScript library to generate a human readable String describing the file size", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"homepage": "http://filesizejs.com", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127
7551