Issue
I have a list of numbers [1,2,3,....]
Now i want to convert them into arabic numbers using django.
Is it possible? Any ideas are welcome.
Solution
try this function:
def enToArNumb(number):
dic = {
0:'۰',
1:'١',
2:'٢',
3:'۳',
4:'۴',
5:'۵',
6:'۶',
7:'۷',
8:'۸',
9:'۹',
.:'۰',
}
return dic.get(number)
and use it like this:
ar_numbers = [enToArNumb(num) for num in numbers]
Answered By - Hasan Ramezani
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.