Android : Populating a TextView with an INTEGER
<p>Am writing an android code where a text view is being populated by a calculated % inside my java class.</p>

<p>As i had to calulate the %, my final variable (calcPerc) is a double type of variable. It wont setText into my TextView. 
Please help.</p>

<p>Code</p>

<pre><code>int totDiff = (totalMA - totalIA);
    double beforeperc = ((double)totDiff / (double)totalIA);
    calPerc = ((double)beforeperc*100);

    percentage = (TextView)findViewById(R.id.populatePercentage);
    percentage.setText(calPerc);
</code></pre>

<p>The error i am getting is</p>

<blockquote>
  <p>The method setText(CharSequence) in the type TextView is not applicable for the arguments (double)</p>
</blockquote>

<p>Also, one more followup question. The variable "calPerc" as it is double, gives me infinite digits after the decimal. How do i round it off to 2 decimals only?</p>
