File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,20 @@ digits.convert_to_word(500443, ordinal=True) # پانصد هزار و چها
5555digits.convert_to_word(30000000000 ) # سی میلیارد
5656```
5757
58+ to convert words to number, you can use this function with different args:
59+ ``` python
60+ from persian_tools import digits
61+
62+ digits.convert_from_word(' منفی سه هزارمین' ) # -3000
63+ digits.convert_from_word(' منفی سه هزارم' , digits = ' fa' ) # -۳۰۰۰
64+ digits.convert_from_word(' منفی سه هزار' ) # -3000
65+ digits.convert_from_word(' سه هزار دویست و دوازده' ) # 3212
66+ digits.convert_from_word(' دوازده هزار بیست دو' , separator = True ) # '12,022'
67+ digits.convert_from_word(' حقوق شیش صد و ۲۷ میلیون تومان سالانه' ) # 627000000
68+ ```
69+
70+ Note: as you can see in examples, this function will remove ordinal suffix by default.
71+
5872### separator
5973Adding or removing thousands separators will handle; default separator is ',' but can change with second input.
6074
You can’t perform that action at this time.
0 commit comments