Shahrul Afiq
Shahrul Afiq

Reputation: 3

Percentage symbol in TextView with one decimal point

How can I set the percentage symbol to a TextView with one decimal point in Android? I have tried using the unicode symbol but its not working.

textES.setText(String.format("%.1f \u0025",percentage));

Upvotes: 0

Views: 1782

Answers (1)

Remees M Syde
Remees M Syde

Reputation: 2609

Have you tried this.

textES.setText(String.format("%.1f",percentage) + "%");

Upvotes: 1

Related Questions