HDFS-13844. Fix the fmt_bytes function in the dfs-dust.js. Contributed by yanghuafeng.

(cherry picked from commit a9c1c55cafc0338bb35d2991f217d4157463f1d3)
This commit is contained in:
Inigo Goiri 2018-09-17 14:37:25 -07:00
parent f0e5651cf4
commit 508fd55c79
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@
var filters = { var filters = {
'fmt_bytes': function (v) { 'fmt_bytes': function (v) {
var UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'ZB']; var UNITS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB'];
var prev = 0, i = 0; var prev = 0, i = 0;
while (Math.floor(v) > 0 && i < UNITS.length) { while (Math.floor(v) > 0 && i < UNITS.length) {
prev = v; prev = v;
@ -28,7 +28,7 @@
i += 1; i += 1;
} }
if (i > 0 && i < UNITS.length) { if (i > 0) {
v = prev; v = prev;
i -= 1; i -= 1;
} }