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(;
EditText promoterstext=(EditText)findViewById(;
EditText passivestext=(EditText)findViewById(;
EditText detractorstext=(EditText)findViewById(;
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(;
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...
Previous Topic:Can't start eclipse on Mac
Next Topic:svg inline?
Goto Forum:

Current Time: Thu Apr 15 06:19:45 GMT 2021

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

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

Back to the top