Skip to main content


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] Sun, 02 December 2012 04:47 Go to next message
Andrew Perez is currently offline Andrew PerezFriend
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] Mon, 03 December 2012 03:01 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
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: Thu Mar 28 13:29:38 GMT 2024

Powered by FUDForum. Page generated in 0.07694 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top