Commit a3aa13c1653a012f905343244e467b8befa320c8

Authored by Nicolás Guarnieri
Exists in master

Merge branch 'master' into 'master'

filtro rellenarDigitos

See merge request !1
1 angular.module('focaFiltros', []) 1 angular.module('focaFiltros', [])
2 .filter('comprobante', function() { 2 .filter('comprobante', function() {
3 return function(valores) { 3 return function(valores) {
4 return (Array(4).join('0') + valores[0]).slice(-4) + '-' + 4 return (Array(4).join('0') + valores[0]).slice(-4) + '-' +
5 (Array(8).join('0') + valores[1]).slice(-8); 5 (Array(8).join('0') + valores[1]).slice(-8);
6 }; 6 };
7 })
8 .filter('rellenarDigitos', function() {
9 return function(valor, cantidad, caracter = 0) {
10 var ceros = '';
11 for (var i = 0; i < cantidad; i++) {
12 ceros += caracter;
13 }
14 return (ceros + valor).slice(cantidad * -1);
15 };
7 }); 16 });
8 17