Browse Source

Correctly apply B unit conversion (#4724)

George Moschovitis 6 years ago
parent
commit
fc75d65502
2 changed files with 16 additions and 0 deletions
  1. 8 0
      web/gui/dashboard.js
  2. 8 0
      web/gui/src/dashboard.js/units-conversion.js

+ 8 - 0
web/gui/dashboard.js

@@ -805,6 +805,14 @@ NETDATA.unitsConversion = {
             'GB/s': 1024 * 1024,
             'TB/s': 1024 * 1024 * 1024
         },
+        'B': {
+            'B': 1,
+            'KB': 1024,
+            'MB': 1024 * 1024,
+            'GB': 1024 * 1024 * 1024,
+            'TB': 1024 * 1024 * 1024 * 1024,
+            'PB': 1024 * 1024 * 1024 * 1024 * 1024
+        },
         'KB': {
             'B': 1 / 1024,
             'KB': 1,

+ 8 - 0
web/gui/src/dashboard.js/units-conversion.js

@@ -39,6 +39,14 @@ NETDATA.unitsConversion = {
             'GB/s': 1024 * 1024,
             'TB/s': 1024 * 1024 * 1024
         },
+        'B': {
+            'B': 1,
+            'KB': 1024,
+            'MB': 1024 * 1024,
+            'GB': 1024 * 1024 * 1024,
+            'TB': 1024 * 1024 * 1024 * 1024,
+            'PB': 1024 * 1024 * 1024 * 1024 * 1024
+        },
         'KB': {
             'B': 1 / 1024,
             'KB': 1,