mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
Fixed when sizes change number of chars
This commit is contained in:
parent
228e384a7a
commit
e2bf94aec0
12
lib/CliUx.js
12
lib/CliUx.js
@ -110,17 +110,17 @@ UX.bytesToSize = function(bytes, precision) {
|
||||
var terabyte = gigabyte * 1024;
|
||||
|
||||
if ((bytes >= 0) && (bytes < kilobyte)) {
|
||||
return bytes + ' B ';
|
||||
return bytes + ' B ';
|
||||
} else if ((bytes >= kilobyte) && (bytes < megabyte)) {
|
||||
return (bytes / kilobyte).toFixed(precision) + ' KB';
|
||||
return (bytes / kilobyte).toFixed(precision) + ' KB ';
|
||||
} else if ((bytes >= megabyte) && (bytes < gigabyte)) {
|
||||
return (bytes / megabyte).toFixed(precision) + ' MB';
|
||||
return (bytes / megabyte).toFixed(precision) + ' MB ';
|
||||
} else if ((bytes >= gigabyte) && (bytes < terabyte)) {
|
||||
return (bytes / gigabyte).toFixed(precision) + ' GB';
|
||||
return (bytes / gigabyte).toFixed(precision) + ' GB ';
|
||||
} else if (bytes >= terabyte) {
|
||||
return (bytes / terabyte).toFixed(precision) + ' TB';
|
||||
return (bytes / terabyte).toFixed(precision) + ' TB ';
|
||||
} else {
|
||||
return bytes + ' B ';
|
||||
return bytes + ' B ';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user