luci-base: cbi.js: properly round down numbers for %u and %d patterns
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 17 Feb 2016 15:33:34 +0000 (16:33 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 17 Feb 2016 15:33:34 +0000 (16:33 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
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':