title: Formatting numbers with same amount of padding
body: <p>I want to format 3 digit floats in Java so they line up vertically such that they look like:</p>
  
  <pre><code>123.45
   99
   23.2
   45
  </code></pre>
  
  <p>When I use DecimalFormat class, I get close, but I want to insert spaces when the item has 1 or 2 digits.</p>
  
  <p>My code:</p>
  
  <pre><code>DecimalFormat formatter = new java.text.DecimalFormat("####.##");
  float [] floats = [123.45, 99.0, 23.2, 45.0];
  
  for(int i=0; i&lt;floats.length; i++)
  {
      float value = floats[i];
  
      println(formatter.format(value));
  }
  </code></pre>
  
  <p>It produces:</p>
  
  <pre><code>123.45
  99
  23.2
  45
  </code></pre>
  
  <p>How can I print it so that all but the first line is shifted over by 1 space?</p>