How to print a double with two decimals in Android? [duplicate]
yourTextView.setText(String.format(“Value of a: %.2f”, a));
yourTextView.setText(String.format(“Value of a: %.2f”, a));
Gravity will only affect alignment and will not set base direction for the text. That it works on some devices and not others may be a font issue, or perhaps an OS version issue. Try adding a RIGHT-TO-LEFT MARK character (\u200F) at the start of your text. This might help the display on an HTC … Read more