title: showing the calculated percentage on Progressbar
body: <p>Hi I want to develop financial application i have taken total salary and amount spent ie. transport,internet,electricity bill so on..... I have taken values and added and calculated percentage also but I am unable to show the calculated percentage in progress bar.</p>
  
  <pre><code>int total = (amount1+amount2+amount3+amount4+amount5);
  double final1=((double)total/amount)*100;
  </code></pre>
  
  <p>Here <code>final1</code> is the calculated percentage now this percentage should be represented in 
  Progressbar</p>
  
  <pre><code>ProgressBar progressbar1 = new ProgressBar(this,null,android.R.attr.progressBarStyleHorizontal);
  progressbar1 = (ProgressBar)findViewById(R.id.progressBar1);
  progressbar1.setPadding(20, 10, 10, 10);
  progressbar1.setScrollBarStyle(ProgressBar.SCROLLBARS_OUTSIDE_INSET);
  progressbar1.setVisibility(View.VISIBLE);
  progressbar1.setProgress(0);
  progressbar1.setMax(100);
  progressbar1.incrementProgressBy(FINAL1);
  </code></pre>
  
  <p>Here <code>final1</code> is in double we need convert it into integer because the below statement will accept only integer</p>
  
  <pre><code>int a = (int)FINAL1;
  int b = (int)Math.round(a);
  
  progressbar1.incrementProgressBy(b); 
  </code></pre>
  
  <p>Please help me I am stuck with this from last 4 days</p>