Return a number when the input is of type number.

I had an issue when using the spinner from jQuery UI and trying to use the validations. I would compare a string to a number. I made this change and it fixed my issue, but I might be missing something.