Initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import re
|
||||
|
||||
E2P_map = {'1': '۱', '2': '۲', '3': '۳', '4': '۴', '5': '۵', '6': '۶', '7': '۷', '8': '۸', '9': '۹', '0': '۰'}
|
||||
|
||||
E2P_map = {'1': '۱', '2': '۲', '3': '۳', '4': '۴', '5': '۵', '6': '۶', '7': '۷', '8': '۸', '9': '۹', '0': '۰'}
|
||||
|
||||
|
||||
# convert persian number to english number
|
||||
def convert_number_to_persian(str_in: str):
|
||||
a = map(lambda ch: E2P_map[ch] if ch in E2P_map else ch, str_in)
|
||||
return ''.join(list(a))
|
||||
|
||||
Reference in New Issue
Block a user