how to get an Integer as result
<p>I have created an application for android that takes three inputs and makes a calculation</p>

<pre><code>else {  
    float result1 = (((new Float(input11.getText().toString())
                     + new Float(input21.getText().toString()))/2));
    float result2 = (new Float(input31.getText().toString());
    if(result1&lt;(result2 - 2)) {
       result1 = result2-2;
       float result=(float) ( (new Float(result1)*0.3)+(new Float(result2)*0.7));
       vprosvasis.setText(Float.toString(result));
    }
    else if(result1&gt;(result2 + 2)) {
       result1=result2+2;
       float result=(float) ( (new Float(result1)*0.3)+(new Float(result2)*0.7));
       vprosvasis.setText(Float.toString(result));
    }
    else {
       float result = (float) ((((new Float(input11.getText().toString())
                                + new Float(input21.getText().toString()))/2)*0.3)
                                + (new Float(input31.getText().toString())*0.7));
       vprosvasis.setText(Float.toString(result));          
    }
}
</code></pre>

<p>Firstly,i would like the result in every statement to be e.x. 12.35 ,not 12,342323...
Secondly,i get in the same way vprosvasis2-vprosvasis7.i would like the final result that i print to be an integer and not a float..</p>

<pre><code>float vprosvasisFloat = Float.parseFloat(vprosvasis.getText().toString());
float vprosvasisFloat2 = Float.parseFloat(vprosvasis2.getText().toString());
float vprosvasisFloat7 = Float.parseFloat(vprosvasis7.getText().toString());
float vprosvasisFloat5 = Float.parseFloat(vprosvasis6.getText().toString());
float vprosvasisFloat4 = Float.parseFloat(vprosvasis7.getText().toString());
float vprosvasisFloat3 = Float.parseFloat(vprosvasis6.getText().toString());
float vprosvasisFloat6 = Float.parseFloat(vprosvasis5.getText().toString());
float genikosvathmosoik = (( new Float(vprosvasis.getText().toString())
               + new Float(vprosvasis2.getText().toString())
               + new Float(vprosvasis3.getText().toString())
               + new Float(vprosvasis4.getText().toString())
               + new Float(vprosvasis5.getText().toString())
               + new Float(vprosvasis6.getText().toString())
                           + new Float(vprosvasis7.getText().toString())) / 7);

moria2oik = (((new Float ((genikosvathmosoik*8)+(vprosvasisFloat * 1.3)+(vprosvasisFloat2 * 0.7))*100)));     
moria3oik=(((new Float ((genikosvathmosoik*8)+(vprosvasisFloat4 * 1.3)+(vprosvasisFloat3 * 0.7))*100)));      
moria5oik=(((new Float ((genikosvathmosoik*8)+(vprosvasisFloat7 *1.3)+(vprosvasisFloat6 * 0.7))*100)));
switch(spinner.getSelectedItemPosition()){
    case 0:
        show = new AlertDialog.Builder(mContext).setTitle(R.string.app_name)
                              .setMessage("1o :  -\n2o :  "
                                         + moria2oik + "\n3o :  " 
                                         + moria3oik + "\n4o :  " 
                                         + moria2oik + "\n5o :  "
                                         + moria5oik)
                              .setPositiveButton("OK", null).show();
    break;
</code></pre>
