How can I show the digits in Arabic format? So, if I have integers: 1,2,3 they become '١', '٢', '٣'
NumberFormat nf=NumberFormat.getInstance(new Locale("ar","EG"));
nf.format(i);
int i = 1;
NumberFormat nf = NumberFormat.getInstance(new Locale("hi", "IN"));
nf.format(i);
If you want to see your number in persian or arabic format, you must use persian or arabic fonts. With android studio's default font you see them in English format . So do like this: 1. Go to this address File \new \ folder \ assets folder You can create a folder that is named as fonts 2. For your textview or edittext that you want to change it's font should do as this
Typeface face=Typeface.createformatassest (getassest (),"fonts/BZAR.TTF"); Textview.settypeface (face);
Fonts is my folder in assets folder.
If you use persian or arabic fonts your numbers format become to arabic format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With