Author: sergeyhalipov
Date: 2007-10-18 04:35:34 -0400 (Thu, 18 Oct 2007)
New Revision: 3437
Modified:
trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js
Log:
http://jira.jboss.com/jira/browse/RF-1114
Modified:
trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js
===================================================================
---
trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js 2007-10-17
23:09:13 UTC (rev 3436)
+++
trunk/ui/inputnumber-spinner/src/main/resources/org/richfaces/renderkit/html/script/SpinnerScript.js 2007-10-18
08:35:34 UTC (rev 3437)
@@ -89,11 +89,18 @@
},
roundFloat: function(x){
- var str = this.delta+"";
- if (str.indexOf(".")==-1) return x;
- var power = str.length - str.indexOf(".") - 1;
- if (power > str.length)
- return x;
+ var str = this.delta.toString();
+ var power = 0;
+ if (!/\./.test(str)) {
+ if (this.delta >= 1) {
+ return x;
+ }
+ if (/e/.test(str)) {
+ power = str.split("-")[1];
+ }
+ } else {
+ power = str.length - str.indexOf(".") - 1;
+ }
var ret = x.toFixed(power);
return ret;
},