Created
March 28, 2016 01:44
-
-
Save victorkurauchi/9e6c94d730f04c8c81be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var bonds = []; | |
| var limit = 6; | |
| var leftZeros = limit - bonds[i].idTitulo.length; | |
| var idTituloCompleted = ''; | |
| console.log("n", bonds[i].idTitulo); | |
| console.log("leftZeros", leftZeros); | |
| while (leftZeros) { | |
| console.log("oi left zero", idTituloCompleted) | |
| idTituloCompleted += "0"; | |
| leftZeros--; | |
| } | |
| if (!leftZeros) { | |
| var newId = idTituloCompleted + bonds[i].idTitulo; | |
| console.log(newId); | |
| bonds[i]['idTituloWithDigits'] = Utils.formatWithDigits(newId); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment