src/numeric-directive.js
function parseViewValue(value) {
                if (angular.isUndefined(value)) {
                    value = '';
                }
                value = (""+value).replace(decimalSeparator, '.');

                // Handle leading decimal point, like ".5"
                if (value.indexOf('.') === 0) {
                    value = '0' + value;
                }

                // Allow "-" inputs only when min < 0
                if (value.indexOf('-') === 0) {
                    if (min >= 0) {
                        value = null;
                        ngModelCtrl.$setViewValue(formatViewValue(lastValidValue));
                        ngModelCtrl.$render();
                    }
                    else if (value === '-') {
                        value = '';
                    }
                }

                var empty = ngModelCtrl.$isEmpty(value);
                if (empty) {
                    lastValidValue = '';
                    //ngModelCtrl.$modelValue = undefined;
                } 
                else {
                    if (regex.test(value) && (value.length <= maxInputLength)) {
                        if ((value > max) && limitMax) {
                            lastValidValue = max;
                        }
                        else if ((value < min) && limitMin) {
                            lastValidValue = min;
                        }
                        else {
                            lastValidValue = (value === '') ? null : parseFloat(value);
                        }
                    }
                    else {
                        // Render the last valid input in the field
                        ngModelCtrl.$setViewValue(formatViewValue(lastValidValue));
                        ngModelCtrl.$render();
                    }
                }

                return lastValidValue;
            }
function parseViewValue(value) {
                if (angular.isUndefined(value)) {
                    value = '';
                }
                value = (""+value).replace(decimalSeparator, '.');

                // Handle leading decimal point, like ".5"
                if (value.indexOf('.') === 0) {
                    value = '0' + value;
                }

                // Allow "-" inputs only when min < 0
                if (value.indexOf('-') === 0) {
                    if (min >= 0) {
                        value = null;
                        ngModelCtrl.$setViewValue(formatViewValue(lastValidValue));
                        ngModelCtrl.$render();
                    }
                    else if (value === '-') {
                        value = '';
                    }
                }

                var empty = ngModelCtrl.$isEmpty(value);
                if (empty) {
                    lastValidValue = '';
                    //ngModelCtrl.$modelValue = undefined;
                } 
                else {
                    if (regex.test(value) && (value.length <= maxInputLength)) {
                        if ((value > max) && limitMax) {
                            lastValidValue = max;
                        }
                        else if ((value < min) && limitMin) {
                            lastValidValue = min;
                        }
                        else {
                            lastValidValue = (value === '') ? null : parseFloat(value);
                        }
                    }
                    else {
                        // Render the last valid input in the field
                        ngModelCtrl.$setViewValue(formatViewValue(lastValidValue));
                        ngModelCtrl.$render();
                    }
                }

                return lastValidValue;
            }
function parseViewValue ( value ) { if ( angular . isUndefined ( value ) ) { value = '' ; } value = ( "" + value ) . replace ( decimalSeparator , '.' ) ; // Handle leading decimal point, like ".5" if ( value . indexOf ( '.' ) === 0 ) { value = '0' + value ; } // Allow "-" inputs only when min < 0 if ( value . indexOf ( '-' ) === 0 ) { if ( min >= 0 ) { value = null ; ngModelCtrl . $setViewValue ( formatViewValue ( lastValidValue ) ) ; ngModelCtrl . $render ( ) ; } else if ( value === '-' ) { value = '' ; } } var empty = ngModelCtrl . $isEmpty ( value ) ; if ( empty ) { lastValidValue = '' ; //ngModelCtrl.$modelValue = undefined; } else { if ( regex . test ( value ) && ( value . length <= maxInputLength ) ) { if ( ( value > max ) && limitMax ) { lastValidValue = max ; } else if ( ( value < min ) && limitMin ) { lastValidValue = min ; } else { lastValidValue = ( value === '' ) ? null : parseFloat ( value ) ; } } else { // Render the last valid input in the field ngModelCtrl . $setViewValue ( formatViewValue ( lastValidValue ) ) ; ngModelCtrl . $render ( ) ; } } return lastValidValue ; }
Parse the view value.
Parse the view value .