title: Converting some hexadecimal string to a decimal integer
body: <p>I wrote some code to convert my hexadecimal display string to decimal integer. However, when input is something like <em>100a</em> or <em>625b</em> (something with a letter) I got an error like this:</p>
  <blockquote>
  <p>java.lang.NumberFormatException: For input string: &quot; 100a&quot;     at
  java.lang.NumberFormatException.forInputString(Unknown Source)     at
  java.lang.Integer.parseInt(Unknown Source)</p>
  </blockquote>
  <p>How can I convert my string with letters to a decimal integer?</p>
  <pre><code>if(display.getText() != null)
  {
      if(display.getText().contains(&quot;a&quot;) || display.getText().contains(&quot;b&quot;) ||
         display.getText().contains(&quot;c&quot;) || display.getText().contains(&quot;d&quot;) ||
         display.getText().contains(&quot;e&quot;) || display.getText().contains(&quot;f&quot;))
      {
          temp1 = Integer.parseInt(display.getText(), 16);
          temp1 = (double) temp1;
      }
      else
      {
          temp1 = Double.parseDouble(String.valueOf(display.getText()));
      }
  }
  </code></pre>