r3156 committed - spinner: default whole number to 0 if not specified. i.e. user input o...

r3156 committed - spinner: default whole number to 0 if not specified. i.e. user input o...


Revision: 3156
Author: pazu2k@gmail.com
Date: Thu Aug 27 13:54:45 2009
Log: spinner: default whole number to 0 if not specified. i.e. user input
of .01 will be converted to 0.01
http://code.google.com/p/jquery-ui/source/detail?r=3156
Modified:
/branches/dev/spinner/ui/ui.spinner.js
=======================================
--- /branches/dev/spinner/ui/ui.spinner.js    Thu Aug 27 09:25:27 2009
+++ /branches/dev/spinner/ui/ui.spinner.js    Thu Aug 27 13:54:45 2009
@@ -379,7 +379,7 @@
                val = val.replace(new
RegExp('\\'+this.options.groupSeparator,'g'), '');
            }
            val = val.replace(new RegExp('[^' + this._validChars()
+ ']', 'gi'), '').split(this.options.radixPoint);
-            result = parseInt(val[0], this.options.radix);
+            result = parseInt(val[0] || 0, this.options.radix);
            if (val.length > 1) {
                result += parseInt(val[1], this.options.radix) /
Math.pow(this.options.radix, val[1].length) *
                    // must test first character of val[0] for minus sign because -0 is
parsed as 0 in result