prettyDiskSize should return something descriptive instead of NaN

undefined
This commit is contained in:
Johannes Zellner
2019-08-22 18:37:27 +02:00
parent 775f6eff0b
commit 3366acde58
+1
View File
@@ -274,6 +274,7 @@ app.filter('prettyMemory', function () {
app.filter('prettyDiskSize', function () {
return function (size) {
if (!size) return 'not available yet';
var i = Math.floor(Math.log(size) / Math.log(1024));
return (size / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]; };
});