Hello my brothers and sisters, I once confused how to keep the numbers 0,1,2,3,4,5,6,7,8,9 converted to Hindi number ( Ù ,Ù¡,Ù¢,Ù£,Ù¤,Ù¥,Ù¦,Ù§,Ù¨,Ù© ...
Hello my brothers and sisters, I once confused how to keep the numbers 0,1,2,3,4,5,6,7,8,9 converted to Hindi number (Ù ,Ù¡,Ù¢,Ù£,Ù¤,Ù¥,Ù¦,Ù§,Ù¨,Ù©) ?
I have search on google but I don't faund it for long times, but eventually also find any, so I share here so easy for you are looking for on this
follow me ya ....
#1st Create arabicChars valriable as follows
char[] arabicChars = {'Ù ','Ù¡','Ù¢','Ù£','Ù¤','Ù¥','Ù¦','Ù§','Ù¨','Ù©'};
#2nd Create a String variable containing the number that will be converted, for example
String angka ="8665544232";
#3rd Create a builder to convert numbers into variable latin imaginable to arabicChars with the following way
StringBuilder builder_angka = new StringBuilder();
for(int i =0;i<angka.length();i++)
{
if(Character.isDigit(angka.charAt(i)))
{
builder_angka.append(arabicChars[(int)(angka.charAt(i))-48]);
}
else
{
builder_angka.append(angka.charAt(i));
}
}
#4th Showing number that has been converted
for example --> JOptionPane.showMessageDialog(null, builder_angka.toString());
or --> System.out.println(""+builder_angka.toString());
or if you used jLabel --> jLabel1.setText(""+builder_angka.toString());
look at the picture below
#5th than I show you the result
Still Confused?? just download sorcecode it..
or if you want to watch on youtube click