Created
December 21, 2015 17:19
-
-
Save Quaggie/3c204ac1b6a8d0946b3a to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
* Adds zeros to the beginning of the cnpj in case of database deletion | |
*/ | |
function verifyCnpj (cnpj) { | |
var strCnpj = cnpj.toString(); | |
if (cnpj.length === 14) return strCnpj; | |
if (strCnpj.length < 14) { | |
return verifyCnpj("0" + strCnpj); | |
} | |
return strCnpj; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment