Show number with comma in TextView
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4220167/inserting-commas-into-integers">Inserting commas into integers</a>  </p>
</blockquote>



<p>I have a textView in which I am showing amount which is working fine.Now I want to show comma in the amount for e.g. 10,000 or 100,000. I know I can do this if i change the widget to EditView,but I want to use TextView.
this is my code</p>

<pre><code>totalAmountTV = (TextView) findViewById(R.id.totalAmount_text_input);
total = total + sum(qty, unitPrice);
totalAmountTV.setText(Integer.toString(total));
</code></pre>

<p>I solved the problem,the issue was that i was putting a String in the format() instead of the int. so the correct code to make this work is </p>

<pre><code>NumberFormat nf = NumberFormat.getInstance(); 
    System.out.println(nf.format(total));
</code></pre>
