Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Making android app -- HELP
icon5.gif  Making android app -- HELP [message #988723] Sat, 01 December 2012 23:47 Go to next message
Andrew Perez is currently offline Andrew Perez
Messages: 1
Registered: December 2012
Junior Member
Hey guys, new to eclipse, I'm making an android app that calculates the percentage in a simple equiation. Is basically a survey where you input the to total amount of answers (OSAT), the amount of possitive responses (Promoters), The people the felt avarage (Passives), and the people that felt bad (Detractors).

My equation so far goes (promoters-detractors)/osat, passives are not taken in count to calculate total, and this is my coding and how everything is looking right now.


public void calculate(View v){
EditText tosattext=(EditText)findViewById(R.id.osattext);
EditText promoterstext=(EditText)findViewById(R.id.promtext);
EditText passivestext=(EditText)findViewById(R.id.passtext);
EditText detractorstext=(EditText)findViewById(R.id.dettext);
Integer osat=Integer.parseInt(tosattext.getText().toString()),prom=Integer.parseInt(promoterstext.getText().toString()),pass=Integer.parseInt(passivestext.getText().toString()),det=Integer.parseInt(detractorstext.getText().toString());
Integer nps=(prom-det)/osat;

TextView npst=(TextView)findViewById(R.id.npstext);
npst.setText("NPS Total: "+nps.toString());
}



The calculation works, problem is that right now the result its shown as "0" because the result is always going to be "0.60" or some decimels. So the idea is for the total to show the result in percentage, ex.

OSAT= 129
promoters= 95
passive= 9 (not use for total, but still need to input in form)
detractors= 20

NPSTotal=(95-20)/129 , NPSTotal= 60%

Appreciate all the help, i'm sure this is would be cake for anybody with experience on eclipse. Thanks in advance.


Re: Making android app -- HELP [message #988763 is a reply to message #988723] Sun, 02 December 2012 22:01 Go to previous message
Russell Bateman is currently offline Russell Bateman
Messages: 3117
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 12/02/2012 09:35 AM, Andrew Perez wrote:
> Hey guys, new to eclipse, I'm making an android app...



http://www.eclipse.org/forums/index.php/t/225513/
Previous Topic:Can't start eclipse on Mac
Next Topic:svg inline?
Goto Forum:
  


Current Time: Tue Jul 22 03:33:00 EDT 2014

Powered by FUDForum. Page generated in 0.01725 seconds