Support for the new Indian currency symbol in java

how to format the number with the new indian currency symbol (₹) using java.if there is some workaround allowing us to share.

+5
source share
2 answers

Until Java correctly supports the new symbol, you can manually specify the currency symbol using its unicode value.

Unicode for Indian Currency Symbol U+20B9

So, to insert this character in a java string, you specify it as \u20B9instead of the default DecimalFormat currency value\u00A4

For instance:

DecimalFormat formatter = new DecimalFormat("\u20B9 000");

Unfortunately, it will be difficult to encode your output to always display the rupee symbol. If you need to support multiple locales, you can check the system.sountry property.

boolean iAmInIndia = "IN".equals(System.getProperty("user.country"));
DecimalFormat formatter = iAmInIndia ? new DecimalFormat("\u20B9 000") : new DecimalFormat("\u00A4 000");

, , , , . Arial Window 7 , .

+4

https://www.karnataka.gov.in/Documents/Rupee_Foradian.ttf Windows ( RUN → type).

ProMed_Font = ( "Rupee Foradian", Font.PLAIN, 10);

example: label.settext( "100" + "`) 100 + rupee symblol

PLease enter the key properly as showed in image

0

All Articles