From 8cab9e2b8fcb6116d49b116bbb747069551d094c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 13 Mar 2011 21:56:31 +0000 Subject: 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(-) (limited to 'libs/web/htdocs/luci-static') diff --git a/libs/web/htdocs/luci-static/resources/cbi.js b/libs/web/htdocs/luci-static/resources/cbi.js index 41e7512062..ddafd79180 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++) -- cgit v1.2.3