Set Indian Rupee symbol on text view

微笑、不失礼 提交于 2019-11-29 20:32:33
androidgeek

Hi use this in Strings

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

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

Sanyam Jain

Use \u20B9 if you want to print the Rupee Symbol
and
Use \u20A8 if you want to print "Rs"

Try this, Instead of Rupee_Foradian.ttf use Rupee.ttf it will work. am getting currency symbol.

Typeface tf = Typeface.createFromAsset(getAssets(), "font/Rupee.ttf");
textView1.setTypeface(tf);
textView1.setText("`");

use on Adapter

Viewholder.price.setText("Price: \u20B9"+dataAdapterOBJ.getPrice());

Copy paste the unicode ₹ to XML or Java and it works just fine. For more info on the unicode refer http://www.fileformat.info/info/unicode/char/20b9/index.htm

praveen acha

Try this code snippet it's working fine in Xamarin.Forms

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

 var rupeeSymbol = india.NumberFormat.CurrencySymbol;
 public static String getIndianRupee(String value) {
    Format format = NumberFormat.getCurrencyInstance(new Locale("en", "in"));
    return format.format(new BigDecimal(value));
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!