I'm creating a currency converting app. I want get answer in two decimal point.
Here is my code :-
public class MainActivity extends AppCompatActivity {
public void pri (View view){
EditText amount = findViewById(R.id.amount);
Double amout = Double.parseDouble(amount.getText().toString());
Double samount = amout * 180;
Toast.makeText(MainActivity.this, "S. " + rsamount.toString(), Toast.LENGTH_SHORT).show();
Log.i("price", amount.getText().toString());
}
Thanks!