title: Minus function not working in my activity
body: <p>I want to reduce "previous meter reading" from current reading. But still bill calculation is done for current reading. Seems it's simple thing, But I can't find what the problem. </p>
  
  <pre><code>Intent i = getIntent();
      final double con = i.getDoubleExtra("Value", 0.0);
  
      final double pre = i.getDoubleExtra("Value1", 0.0);
  
      cur_units.setText("" + con);
      pre_units.setText("" + pre);
  
         Test = con - pre;
  
      Units = Test;
      if (Units &lt;= 5) {
          Amount = Units * 12;
          Ser_Charge = 50;
      } else if (Units &lt;= 10) {
          // For the First Five Units Charge = 60 (5 * 12)
          // Next, we are removing those 5 units from total units
          Amount = 60 + ((Units - 5) * 16);
          Ser_Charge = 65;
      } else if (Units &lt;= 15) {
          // First Five Units charge = 60, and 6 - 10 is 80 (5 * 16)
          // Next, we are removing those 10 units from total units
          Amount = 60 + 80 + ((Units - 10) * 20);
          Ser_Charge = 70;
      } else if (Units &lt;= 20) {
  </code></pre>