This is well explained here:
http://www.javascripter.net/faq/keyboardinputfiltering.htm[
^].
You need to add an additional check.
ret = (49 <= keyCode && keyCode <= 57) ||
(110 <= keyCode && keyCode <= 190) ||
(8 == keyCode);
Note that I also removed redundant outer brackets and excluded the use of the array, which you used just for the check for backspace (8), which makes little sense. Keep it simple.
—SA