Try with below code:
$(".numeric").bind("keypress", function (e) {
var keyCode = e.which ? e.which : e.keyCode
var ret = ( keyCode== 46 || ($(".numeric").val().length == 2) || ($(".numeric").val().length == 0 && keyCode >= 48 && keyCode <= 53 ) || specialKeys.indexOf(keyCode) != -1);
if (ret) {
$(this).next().remove();
}
else {
alert('error');
}
return ret;
});
Note: It will allows value like 2.9/3.4 etc but not 3.99 if you need it the it logic needs to change.