How can I format an integer to have two decimals?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/14197319/how-to-format-an-integer-to-have-two-decimals">How to format an integer to have two decimals?</a>  </p>
</blockquote>



<p>I am struggling with this piece of code here.</p>

<pre><code>DecimalFormat df = new DecimalFormat("00.##");
df.setMinimumFractionDigits(2);
return df.format(Integer.valueOf(amount));
</code></pre>

<p>Here's what I need:</p>

<blockquote>
  <p>Input: 2, Output: 2.00</p>
  
  <p>Input 20, Output: 20,00</p>
  
  <p>Input 1003, Output: 100,30</p>
  
  <p>Input 120323, Output: 1.203,23 (a thousand two hundred and three and twenty three cents)</p>
</blockquote>

<p>I can't use DecimalFormat because I don't have a pattern "example ##.##".</p>

<p>I should always have two decimals. If the amount is less that 100, then I only have to take the amount itself and add ".00" If it is bigger than 100, means that the two last digits are the two decimals I need. They are the cents.</p>

<p>Can anyone help me?</p>
