Update HexaDecimalToDecimal.java
This commit is contained in:
parent
00736054bc
commit
d5c673aa97
@ -11,8 +11,7 @@ public class HexaDecimalToDecimal {
|
|||||||
int val = 0;
|
int val = 0;
|
||||||
for (int i = 0; i < hex.length(); i++)
|
for (int i = 0; i < hex.length(); i++)
|
||||||
{
|
{
|
||||||
char c = hex.charAt(i);
|
int d = digits.indexOf(hex.charAt(i));
|
||||||
int d = digits.indexOf(c);
|
|
||||||
val = 16*val + d;
|
val = 16*val + d;
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
|
Loading…
Reference in New Issue
Block a user