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 c084709f92a451664201744d5dc1ed01d8b0a93e..26fd92471ff5d9faaf40883b667ca775015a4555 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':