Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display rupee symbol in my java class?

Tags:

java

if(this.currency.equalsIgnoreCase("₹")) {
    r="₹ "+r;
}

I want to compare (Indian rupee symbol) in java. Here I am trying to print currency rupee symbol, but instead it is displaying the symbol like â?¹.

How to overcome this problem?

like image 427
Lakshmi Prasanna Avatar asked Dec 19 '22 03:12

Lakshmi Prasanna


1 Answers

You can try with:

if(this.currency.equals("\u20B9")) {
    r="₹ "+r;
}

"\u20B9" is the java encoding for rupee symbol.

More info:

  • Unicode Character 'INDIAN RUPEE SIGN' .
like image 65
CoderNeji Avatar answered Jan 07 '23 17:01

CoderNeji