diff --git a/numeric/jquery.numeric.js b/numeric/jquery.numeric.js index 6f31f69..dfd8c8a 100644 --- a/numeric/jquery.numeric.js +++ b/numeric/jquery.numeric.js @@ -143,6 +143,10 @@ $.fn.numeric.keypress = function(e) allow = false; } } + //if the key pressed is '.' and the decimal symbol is not present yet, add it to the field. + else if(decimal && key == 46 && $.inArray(decimal, value.split('')) == -1){ + $(this).val($(this).val() + decimal); + } } else { @@ -157,7 +161,6 @@ $.fn.numeric.keypress = function(e) allow = false; } } - } return allow; };