title: What does the dollar sign ($) do in a printf format string?
body: <p>I am trying to format in java using the printf statement like in this webpage: <a href="http://www.tutorialspoint.com/java/io/console_printf.htm" rel="nofollow">Click Here</a>. But I just can't figure out what the purpose of the $ sign is. Can someone please explain this to me?</p>
  
  <p>Input:</p>
  
  <pre><code>java 100
  cpp 65
  python 50
  </code></pre>
  
  <p>Expected Output: ( there should be a space instead of _ )</p>
  
  <pre><code> ================================
   java___________100 
   cpp___________065 
   python_________050 
   ================================
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>public class Solution {
  
      public static void main(String[] args) {
          Scanner sc=new Scanner(System.in);
          System.out.println("================================");
          for(int i=0;i&lt;3;i++)
          {
              String s1=sc.next();
              int x=sc.nextInt();
              System.out.printf(s1 + "%03d", x);
              System.out.println();
          }
          System.out.println("================================");
  
      }
  }
  </code></pre>