Skip to content Skip to sidebar Skip to footer

Converting Hex Answer To Dec?

I need some help in converting the answers I get from my OBD adapter in my car to decimal and then later adding whatever value comes out of the conversion to a formula and printed

Solution 1:

Use String#substring to extract the final four digits (call that s), followed by

Integer.parseInt(s, 16)

to convert that to an integer. The 16 tells the parser that the s is hexadecimal.

Post a Comment for "Converting Hex Answer To Dec?"