title: Exception in thread "main" java.util.IllegalFormatConversionException: d != java.lang.String
body: <p>I'm new to Java and I'm not sure how to fix the error I'm getting when trying to run this code: </p>
  
  <pre><code>import java.util.Scanner;
  public class P3_3 
  {
  
      public static void main(String[] args) 
      {
          Scanner in = new Scanner(System.in);
          System.out.print("Please enter a number: ");
          int number = in.nextInt();
          if (number &lt; 0) number *= -1;
          if (number &gt;= 10 &amp;&amp; number &lt; 100)
          {
              number = 2;
          }
          else if (number &gt;= 100 &amp;&amp; number &lt; 1000)
          {
              number = 3;
          }
          else if (number &gt;= 1000 &amp;&amp; number &lt; 10000)
          {
              number = 4;
          }
          else if (number &gt;= 10000 &amp;&amp; number &lt; 100000)
          {
              number = 5;
          }
          else if (number &gt;= 100000 &amp;&amp; number &lt; 1000000)
          {
              number = 6;
          }
          else if (number &gt;= 1000000 &amp;&amp; number &lt; 10000000)
          {
              number = 7;
          }
          else if (number &gt;= 10000000 &amp;&amp; number &lt; 100000000)
          {
              number = 8;
          }
          else if (number &gt;= 100000000 &amp;&amp; number &lt; 1000000000)
          {
              number = 9;
          }
          else
          {
              System.out.println("Number is greater than 10 billion.");
          }
          System.out.printf("%d has ", number + "digits.");
      }
  }
  </code></pre>
  
  <p>I'm trying to print how many digits the number has, by checking whether the number is <code>&gt;= 10, &gt;= 100</code> and so on...
  I run the code and I'm able to input an int but once I input it and press enter all I get it an error and can't seem to see what I have done wrong. Can anyone enlighten me? </p>