luci-base: cbi.js: properly round down numbers for %u and %d patterns
[project/luci.git] / modules / luci-base / htdocs / luci-static / resources / cbi.js
index c084709..26fd924 100644 (file)
@@ -1360,11 +1360,11 @@ String.prototype.format = function()
                                                break;
 
                                        case 'd':
-                                               subst = (+param || 0);
+                                               subst = ~~(+param || 0);
                                                break;
 
                                        case 'u':
-                                               subst = Math.abs(+param || 0);
+                                               subst = ~~Math.abs(+param || 0);
                                                break;
 
                                        case 'f':