Skip to content

Commit

Permalink
bug
Browse files Browse the repository at this point in the history
  • Loading branch information
majiidd committed Mar 24, 2024
1 parent a52ea89 commit 3803ffc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Provides Jalali (also known as Shamsi or Persian) dates and datetimes functionalities, among other tools.
- It converts between Jalali and Gregorian dates and datetimes (based on python datetime's module).
- It supports operators like +, -, ==, and >=.
- It supports operators like `+`, `-`, `==`, and `>=`.
- It includes timezone support.
- It converts between Arabic and Persian characters/digits.
- It turns numbers into Persian words.
Expand Down
2 changes: 1 addition & 1 deletion persiantools/digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
1000: lambda n, depth: HUNDREDS[n // 100 - 1] + _to_word(n % 100, True),
1000000: lambda n, depth: _to_word(n // 1000, depth) + BIG_RANGE[0] + _to_word(n % 1000, True),
1000000000: lambda n, depth: _to_word(n // 1000000, depth) + BIG_RANGE[1] + _to_word(n % 1000000, True),
1000000000000: lambda n, depth: _to_word(n // n, depth) + BIG_RANGE[2] + _to_word(n % 1000000000, True),
1000000000000: lambda n, depth: _to_word(n // 1000000000, depth) + BIG_RANGE[2] + _to_word(n % 1000000000, True),
1000000000000000: lambda n, depth: _to_word(n // 1000000000000, depth)
+ BIG_RANGE[3]
+ _to_word(n % 1000000000000, True),
Expand Down
3 changes: 2 additions & 1 deletion tests/test_digits.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def test_to_letter(self):
self.assertEqual(digits.to_word(500253), "پانصد هزار و دویست و پنجاه و سه")
self.assertEqual(digits.to_word(6000123), "شش میلیون و یکصد و بیست و سه")
self.assertEqual(digits.to_word(1000000985), "یک میلیارد و نهصد و هشتاد و پنج")
self.assertEqual(digits.to_word(100000000000004), "یکصد تریلیون و چهار")
self.assertEqual(digits.to_word(100_000_000_000_004), "یکصد تریلیون و چهار")
self.assertEqual(digits.to_word(9_512_026_000_000), "نه تریلیون و پانصد و دوازده میلیارد و بیست و شش میلیون")

self.assertEqual(digits.to_word(-305), "منفی سیصد و پنج")
self.assertEqual(digits.to_word(10.02), "ده و دو صدم")
Expand Down

0 comments on commit 3803ffc

Please sign in to comment.