Establecer símbolo de Rupia india en la vista de texto


Estoy desarrollando una aplicación. Y necesito establecer el símbolo de la rupia india en la vista de texto que se establece con el texto como cantidad.

Símbolo:

introduzca la descripción de la imagen aquí

Estoy teniendo la fuente o.Archivo TTF de esto en la carpeta Assets/fonts.

Y traté de usarlo como:

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("`");

Como la fuente de configuración anterior, obtuve un error de puntero nulo.

En el archivo de Word después de elegir la fuente y escribir ` tenemos el símbolo. pero no está funcionando en Android.

Entonces qué los pasos que debo seguir para hacer esto...

Author: Manoj Fegde, 2013-03-01

7 answers

introduzca la descripción de la imagen aquí

Hola utilice esto en cadenas

Para imprimir símbolo de rupia : <string name="Rs">\u20B9</string>

Para imprimir Rs texto: <string name="rs">\u20A8</string>

 156
Author: androidgeek,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-12-16 09:08:11

Use \u20B9 si desea imprimir el Rupee Symbol
y
Utilice \u20A8 si desea imprimir "Rs"

 14
Author: Sanyam Jain,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-05-05 11:30:29

Pruebe esto, en lugar de Rupee_Foradian.ttf use Rupee.ttf funcionará. estoy recibiendo símbolo de moneda.

Typeface tf = Typeface.createFromAsset(getAssets(), "font/Rupee.ttf");
textView1.setTypeface(tf);
textView1.setText("`");
 10
Author: MuraliGanesan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-03-02 05:15:56

Copie y pegue el unicode en XML o Java y funciona bien. Para obtener más información sobre unicode, consulte http://www.fileformat.info/info/unicode/char/20b9/index.htm

 3
Author: Bala Vishnu,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-07-03 10:29:04

Utilizar en el adaptador

Viewholder.price.setText("Price: \u20B9"+dataAdapterOBJ.getPrice());
 3
Author: Karan Chunara,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-02-12 09:33:48

Pruebe este fragmento de código que funciona bien en Xamarin.Forms

 CultureInfo india = new CultureInfo("hi-IN");

 var rupeeSymbol = india.NumberFormat.CurrencySymbol;
 0
Author: praveen acha,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-05-10 13:18:34
 public static String getIndianRupee(String value) {
    Format format = NumberFormat.getCurrencyInstance(new Locale("en", "in"));
    return format.format(new BigDecimal(value));
}
 0
Author: Gautam Surani,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-06-21 06:51:54