-1
Hello, in this section I take a double multiplic value to 0.3 and display in a textview, as I show the result with 2 decimal places?
deslocamento.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
if (deslocamento.isChecked()){
double valorDeslocamento1 = Double.parseDouble(valorViagem.getText().toString())*0.3;
valorDeslocamento.setText( String.valueOf(valorDeslocamento1));
}
}
} );
Does this Answer your Question? Formatting a double in java
– Gustavo