Merge pull request #5540 from jow-/wireguard-peer-gridsection
[project/luci.git] / modules / luci-base / htdocs / luci-static / resources / cbi.js
index 9728e03e120fdcef153a1103065c14f3610fd3bd..9200954d1e791f088f9bf66bab9a10637e1435f1 100644 (file)
@@ -657,7 +657,11 @@ String.prototype.format = function()
                                                for (i = 0; (i < units.length) && (val > mf); i++)
                                                        val /= mf;
 
-                                               subst = (i ? val.toFixed(pr) : val) + units[i];
+                                               if (i)
+                                                       subst = val.toFixed(pr) + units[i] + (mf == 1024 ? 'i' : '');
+                                               else
+                                                       subst = val + ' ';
+
                                                pMinLength = null;
                                                break;
                                }
@@ -773,7 +777,7 @@ function cbi_update_table(table, data, placeholder) {
                                        var td = trow.appendChild(E('td', {
                                                'class': titles[i].className,
                                                'data-title': (text !== '') ? text : null
-                                       }, row[i] || ''));
+                                       }, (row[i] != null) ? row[i] : ''));
 
                                        td.classList.remove('th');
                                        td.classList.add('td');