From 8cab9e2b8fcb6116d49b116bbb747069551d094c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 13 Mar 2011 21:56:31 +0000 Subject: [PATCH] libs/web: explicitely cast input value of %m pattern to float in order to avoid throwing an exception in toFixed() with very low values --- libs/web/htdocs/luci-static/resources/cbi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js index 41e751206..ddafd7918 100644 --- a/libs/web/htdocs/luci-static/resources/cbi.js +++ b/libs/web/htdocs/luci-static/resources/cbi.js @@ -1032,7 +1032,7 @@ if( ! String.format ) var pr = pPrecision ? Math.floor(10*parseFloat('0'+pPrecision)) : 2; var i = 0; - var val = (param || 0); + var val = parseFloat(param || 0); var units = [ '', 'K', 'M', 'G', 'T', 'P', 'E' ]; for (i = 0; (i < units.length) && (val > mf); i++) -- 2.11.0