Converting some hexadecimal string to a decimal integer

It looks like there’s an extra (leading) space character in your string (” 100a”). You can use trim() to remove leading and trailing whitespaces:

temp1 = Integer.parseInt(display.getText().trim(), 16);

Or if you think the presence of a space means there’s something else wrong, you’ll have to look into it yourself, since we don’t have the rest of your code.

Leave a Comment