<commit_before>(function () {
    "use strict";

    angular
        .module('orange')
        .directive('onlyNumbers', onlyNumbers);

    function onlyNumbers() {
        return {
            require: '?ngModel',
            scope: {},
            link: function (scope, element, attributes, ngModel) {
                var _value;
                ngModel.$parsers.unshift(function (val) {
                    if (_value === undefined) {
                        _value = ngModel.$modelValue;
                    }
                    if (val === undefined || val === null) {
                        val = '';
                    }
                    if (val.toString().match(/^(\d+\.?\d*)?$/g)) {
                        _value = val;
                    }
                    ngModel.$viewValue = _value;
                    ngModel.$render();
                    return _value;
                });
            }
        }
    }

})();
<commit_msg>[bugfix][ORANGE-293] Fix zero mount for doses<commit_after>(function () {
    "use strict";

    angular
        .module('orange')
        .directive('onlyNumbers', onlyNumbers);

    function onlyNumbers() {
        return {
            require: '?ngModel',
            scope: {},
            link: function (scope, element, attributes, ngModel) {
                var _value;
                ngModel.$parsers.unshift(function (val) {
                    if (_value === undefined) {
                        _value = ngModel.$modelValue;
                    }
                    if (val === undefined || val === null) {
                        val = '';
                    }
                    if (val.toString().match(/^(\d+\.?\d*)?$/g) && val != 0) {
                        _value = val;
                    }
                    ngModel.$viewValue = _value;
                    ngModel.$render();
                    return _value;
                });
            }
        }
    }

})();

{'fraction_non_alphanumeric': 0.13206577595066804, 'fraction_numerical': 0.0020554984583761563, 'mean_word_length': 0.9887640449438202, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5519746', 'n_tokens_mistral': 510, 'n_tokens_neox': 457, 'n_words': 93}