Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

double to string in java without tovalue

totalCost.setOnTouchListener(new OnTouchListener() {
  public boolean onTouch(View v, MotionEvent event) {
    try {
      double priceG = Double.parseDouble(priceGal.getText().toString());
      double valG = Double.parseDouble(volGal.toString());
      double total = priceG * valG;
      String tot = new Double(total).toString();
      totalCost.setText(tot);
    } catch(Exception e) {
      Log.e("text", e.toString());
    }

    return false;
  }         
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #double #string #java #tovalue
ADD COMMENT
Topic
Name
2+1 =