libs/web: explicitely cast input value of %m pattern to float in order to avoid throw...
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 13 Mar 2011 21:56:31 +0000 (21:56 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 13 Mar 2011 21:56:31 +0000 (21:56 +0000)
libs/web/htdocs/luci-static/resources/cbi.js

index 41e75120620aaf7ac1e018e61f4c77575f820d9e..ddafd791805dfbfaa2ef0219ec0a01fedee1d164 100644 (file)
@@ -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++)