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
public String convertir(String numero, int baseOrigen, int baseDestino) { | |
int numeroBase10 = Integer.parseInt(numero, baseOrigen); // convierte a base 10 cualquier numero en otra base | |
String numeroBaseB = Integer.toString(numeroBase10, baseDestino); // convierte numeroBase10 a otra base | |
return numeroBaseB; | |
} |