printf %f with 4 decimals and the symbol "%" in the end
<p>I have a vector:</p>

<pre><code>p[0]=0.40816269
p[1]=0.37576407
p[2]=0.16324950
p[3]=0.05282373
</code></pre>

<p>I need to print the values of the vector as percentage with 4 decimals.
I tried:</p>

<pre><code>for(int i=0; i&lt;p.length;i++)
{
    System.out.printf("Criterion "+i+" has the weigth=%.4f \n" , p[i]*100);
}
</code></pre>

<p>which gives me:</p>

<pre><code>Criterion 0 has the weigth=40.8163, .....
</code></pre>

<p>but I want to print:</p>

<pre><code>Criterion 0 has the weigth=40.8163 %, ..... 
</code></pre>

<p>I cannot add the symbol "%"  in the end of each row. 
If I try:</p>

<pre><code>System.out.printf("Criterion "+i+" has the weigth=%.4f %\n" , p[i]*100);
</code></pre>

<p>or:</p>

<pre><code>System.out.printf("Criterion "+i+" has the weigth=%.4f "+"%\n" , p[i]*100);
</code></pre>

<p>program throws an exception. Thank you in advance!</p>
