MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / numberFormatterParser

Function numberFormatterParser

lib/test/angular/1.8.0/angular.js:26879–26897  ·  view source on GitHub ↗
(ctrl)

Source from the content-addressed store, hash-verified

26877}
26878
26879function numberFormatterParser(ctrl) {
26880 ctrl.$parsers.push(function(value) {
26881 if (ctrl.$isEmpty(value)) return null;
26882 if (NUMBER_REGEXP.test(value)) return parseFloat(value);
26883
26884 ctrl.$$parserName = 'number';
26885 return undefined;
26886 });
26887
26888 ctrl.$formatters.push(function(value) {
26889 if (!ctrl.$isEmpty(value)) {
26890 if (!isNumber(value)) {
26891 throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);
26892 }
26893 value = value.toString();
26894 }
26895 return value;
26896 });
26897}
26898
26899function parseNumberAttrVal(val) {
26900 if (isDefined(val) && !isNumber(val)) {

Callers 2

numberInputTypeFunction · 0.70
rangeInputTypeFunction · 0.70

Calls 1

isNumberFunction · 0.70

Tested by

no test coverage detected