luci-base: cbi.js: properly round down numbers for %u and %d patterns

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
Jo-Philipp Wich 2016-02-17 16:33:34 +01:00
parent 21bf16ce04
commit 99f5d4e902

View file

@ -1360,11 +1360,11 @@ String.prototype.format = function()
break; break;
case 'd': case 'd':
subst = (+param || 0); subst = ~~(+param || 0);
break; break;
case 'u': case 'u':
subst = Math.abs(+param || 0); subst = ~~Math.abs(+param || 0);
break; break;
case 'f': case 'f':