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

This commit is contained in:
Inigo Goiri 2018-09-17 14:37:25 -07:00
parent 23a6137a40
commit d1541932db
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@
var filters = {
'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;
while (Math.floor(v) > 0 && i < UNITS.length) {
prev = v;
@ -28,7 +28,7 @@
i += 1;
}
if (i > 0 && i < UNITS.length) {
if (i > 0) {
v = prev;
i -= 1;
}