Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Indian Rupee symbol on text view

I am developing an application. And i need to set the symbol of Indian rupee on text view which is set with the text as amount.

Symbol:

enter image description here

I am having the font or .TTF file of this in Assets/fonts folder.

And i tried to use it as :

Typeface typeFace_Rupee = Typeface.createFromAsset(getAssets(),fonts/Rupee_Foradian.ttf"); TextView tvRupee = (TextView) findViewById(R.id.textview_rupee_mlsaa); tvRupee.setTypeface(typeFace_Rupee);  // Tried to set symbol on text view as follows. tvRupee.setText("`"); 

As above setting font i got null pointer error.

In word file after choosing font and typing ` we got the symbol. but it is not working in android.

So what steps should i follow to do this...

like image 966
Manoj Fegde Avatar asked Mar 01 '13 13:03

Manoj Fegde


People also ask

How can I add Rupee symbol to text?

Insert Rupee Symbol in MS Word Using Keyboard If you don't have the rupee icon, press Ctrl+Alt+4 keys together. You could also press the side Alt key (Alt_GR)+₹ symbol if it is available on your keyboard. The rupee symbol can also be added using the left side Alt key and then type 8377 on the numeric pad.

How can I add Indian rupee symbol in Gboard?

Gboard allows you to type a Rupee symbol on your Android smartphone. Head to Settings, you can easily enter the settings by tapping and holding on the Comma ','. Alternately, go to Settings -> Language & Input -> Gboard -> Languages and tap on Add Keyboard. Choose English (India) from the given languages.

How do I type ₹ on Windows?

Type 20B9 and then press ALT + x keys. As soon as you press this key combination, the text 20B9 will be replaced by the Indian currency's new Rupee symbol (₹).


1 Answers

enter image description here

Hi use this in Strings

For print rupee symbol: <string name="Rs">\u20B9</string>

For print Rs text: <string name="rs">\u20A8</string>

like image 140
androidgeek Avatar answered Sep 24 '22 15:09

androidgeek