yourTextView.setText(String.format("Value of a: %.2f", a));
You can use a DecimalFormat, or String.format("%.2f", a);
yourTextView.setText(String.format("Value of a: %.2f", a));
You can use a DecimalFormat, or String.format("%.2f", a);