title: Java formatting, how do I get a symbol to stick to an int?
body: <p>I'm trying to print out a metric to imperial table and the format needs to be very specific.</p>
  
  <p>Using the format string :</p>
  
  <pre><code>System.out.printf("%-2d%-1s|",counter++,"\'");
  </code></pre>
  
  <p>I get the output:
  "1 '|"</p>
  
  <p>I need it to be:
  "1' |"</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I also need it to be left justified, with a total of 4 spaces used, even when the int is 2 digits</p>
  
  <p>Many thanks</p>