mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-08 02:04:31 +08:00
Update HexaDecimalToDecimal.java
This commit is contained in:
@ -6,7 +6,7 @@ public class HexaDecimalToDecimal {
|
|||||||
|
|
||||||
// convert hexadecimal to decimal
|
// convert hexadecimal to decimal
|
||||||
public static int getHexaToDec(String hex) {
|
public static int getHexaToDec(String hex) {
|
||||||
String digits = "012345678910ABCDEFF";
|
String digits = "0123456789ABCDEF";
|
||||||
hex = hex.toUpperCase();
|
hex = hex.toUpperCase();
|
||||||
int val = 0;
|
int val = 0;
|
||||||
for (int i = 0; i < hex.length(); i++) {
|
for (int i = 0; i < hex.length(); i++) {
|
||||||
|
Reference in New Issue
Block a user