Skip to content

- add uzs for ru and en #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions num2words/lang_EU.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class Num2Word_EU(Num2Word_Base):
'MXN': (('peso', 'pesos'), GENERIC_CENTS),
'RON': (('leu', 'lei', 'de lei'), ('ban', 'bani', 'de bani')),
'INR': (('rupee', 'rupees'), ('paisa', 'paise')),
'HUF': (('forint', 'forint'), ('fillér', 'fillér'))
'HUF': (('forint', 'forint'), ('fillér', 'fillér')),
'UZS': (('sum', 'sums'), ('tiyin', 'tiyins'))
}

CURRENCY_ADJECTIVES = {
Expand All @@ -56,7 +57,8 @@ class Num2Word_EU(Num2Word_Base):
'MXN': 'Mexican',
'RON': 'Romanian',
'INR': 'Indian',
'HUF': 'Hungarian'
'HUF': 'Hungarian',
'UZS': 'Uzbekistan'
}

GIGA_SUFFIX = "illiard"
Expand Down
3 changes: 3 additions & 0 deletions num2words/lang_RU.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ class Num2Word_RU(Num2Word_Base):
'KZT': (
('тенге', 'тенге', 'тенге'), ('тиын', 'тиына', 'тиынов')
),
'UZS': (
('сум', 'сума', 'сумов'), ('тийин', 'тийина', 'тийинов')
),
}

def setup(self):
Expand Down
6 changes: 6 additions & 0 deletions tests/test_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ def test_to_currency(self):
"four pesos and one cent"
)

self.assertEqual(
num2words('2000.00', lang='en', to='currency', separator=' and',
cents=True, currency='UZS'),
"two thousand sums and zero tiyins"
)

def test_to_year(self):
# issue 141
# "e2 e2"
Expand Down
5 changes: 5 additions & 0 deletions tests/test_ru.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,8 @@ def test_to_currency(self):
'одна тысяча двести тридцать четыре доллара, пятьдесят шесть '
'центов'
)
self.assertEqual(
num2words(10122, lang='ru', to='currency', currency='UZS',
separator=' и'),
'сто один сум и двадцать два тийина'
)