MCPcopy
hub / github.com/angular-ui/ui-router / padNumber

Function padNumber

test/angular/1.4/angular-mocks.js:581–593  ·  view source on GitHub ↗
(num, digits, trim)

Source from the content-addressed store, hash-verified

579}
580
581function padNumber(num, digits, trim) {
582 var neg = '';
583 if (num < 0) {
584 neg = '-';
585 num = -num;
586 }
587 num = '' + num;
588 while (num.length < digits) num = '0' + num;
589 if (trim) {
590 num = num.substr(num.length - digits);
591 }
592 return neg + num;
593}
594
595
596/**

Callers 1

angular-mocks.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected