Skip to content

Instantly share code, notes, and snippets.

@pablotolentino
Created June 29, 2021 04:38
Show Gist options
  • Save pablotolentino/8e5e62829d8e7da780406eab44cdad24 to your computer and use it in GitHub Desktop.
Save pablotolentino/8e5e62829d8e7da780406eab44cdad24 to your computer and use it in GitHub Desktop.
public static convertirAEntero(texto): number {
if (texto !== null) {
if (texto.length > 0) {
if (!isNaN(texto)) {
return parseInt(texto);
} else {
return 0;
}
} else {
return 0;
}
} else {
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment