Fix prettyDiskSize to use 1000 instead of 1024

This commit is contained in:
Girish Ramakrishnan
2020-04-01 16:26:47 -07:00
parent 7d52be6e99
commit b93b1a6eec
3 changed files with 6 additions and 5 deletions

View File

@@ -295,11 +295,12 @@ app.filter('prettyMailSize', function () {
return (size / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]; };
});
// df -H style (si) output
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]; };
var i = Math.floor(Math.log(size) / Math.log(1000));
return (size / Math.pow(1000, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]; };
});
app.filter('installationActive', function () {