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
pragma solidity ^0.4.24; | |
/** | |
* @title SafeMath | |
* @dev Math operations with safety checks that throw on error | |
*/ | |
library SafeMath { | |
/** | |
* @dev Multiplies two numbers, throws on overflow. | |
*/ |
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
function phoneNumberFormat(phone){ | |
phoneAux = phone.replace(/\D/g, '') | |
if (phoneAux.length == 10){ | |
parsedPhone = phoneAux.substr(0,3) +"-"+phoneAux.substr(3,3)+"-"+phoneAux.substr(6,phoneAux.length) | |
} | |
else if(phoneAux.length == 11 && phoneAux.substr(0,1) == "1"){ | |
parsedPhone = phoneAux.substr(1,3) +"-"+phoneAux.substr(4,3)+"-"+phoneAux.substr(7,phoneAux.length) | |
} | |
else{ | |
parsedPhone = phoneAux |