diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-03-13 21:56:31 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-03-13 21:56:31 +0000 |
commit | 8cab9e2b8fcb6116d49b116bbb747069551d094c (patch) | |
tree | 23a2ae0ef11bcbeb10334e40153ff63b5fa73634 /libs | |
parent | 831654f504c7a9ef8efc9286e1f09cf942ce05c8 (diff) |
libs/web: explicitely cast input value of %m pattern to float in order to avoid throwing an exception in toFixed() with very low values
Diffstat (limited to 'libs')
-rw-r--r-- | libs/web/htdocs/luci-static/resources/cbi.js | 2 |
1 files changed, 1 insertions, 1 deletions
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++) |