title: android: calculate double percentage?
body: <p>I want to calculate percentage. But it's giving me wrong result(2.78674E7).</p>
  
  <p>Following's my code:</p>
  
  <pre><code>public class DetailActivity extends AppCompatActivity {
  
      private Button btn_pre_payment;
      private EditText et_pre_payment;
  
      private double monthlyPayment;
      private double allPayment = 139337000;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_detail);
          btn_pre_payment = (Button)findViewById(R.id.bt_prepayment);
          et_pre_payment = (EditText)findViewById(R.id.et_prepayment);
  
          btn_pre_payment.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  if(et_pre_payment.getText().length() &gt; 0){
  
                      float value = Float.valueOf(et_pre_payment.getText().toString());
                      if(value &gt;= 10){
  
                          InputMethodManager in = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                          in.hideSoftInputFromWindow(et_pre_payment.getApplicationWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
  
  
                              **monthlyPayment = (allPayment / 100f) * value;
                              tvMonthlyPaymentH.setText(String.valueOf(monthlyPayment));
                              remainderPayment -= monthlyPayment;**
  
                          }
  
                      } else Toast.makeText(DetailActivity.this, "Low is 10%!", Toast.LENGTH_SHORT).show();
                  } else {
                      Toast.makeText(DetailActivity.this, "Enter value!", Toast.LENGTH_SHORT).show();
                  }
              }
          });
      }
  }
  </code></pre>
  
  <p>Why can't it calculate correct result? It gives me 2.78674E7. I want to calculate percentage.</p>