I have got a task to restrict textbox from alphabetic values. Only floating point values are possible. After the decimal we have to write out two digits. I did this but it does
You should change e.keyCode to e.charCode.
String.fromCharCode(e.charCode)