How to print a double with two decimals in Android? [duplicate]

yourTextView.setText(String.format("Value of a: %.2f", a));

Leave a Comment