How do I control the alignment of formatted text in Java?
<p>I'm knocking my head here using System.out.printf and I really don't understand something that seems that it should be much more simple.</p>

<pre><code>public class main{
    public static void main(String args[]){
        double dog  = 3.85;
        double cat = 333.85;
        System.out.printf("Hola:%7.1f\n",dog);
        System.out.printf("Hola:%5.0f", cat);
    }
}
</code></pre>

<p>I'm trying to understand what the significance is of the numbers after the percentage symbol. In short in the line:</p>

<pre><code>System.out.print("Number: %x.y", someNumber);
</code></pre>

<p>what does the x tell me and what does the y tell me?</p>
