Skip to content

Commit

Permalink
[FIX] ISO code for Belarusian language is be, not by. + coverage
Browse files Browse the repository at this point in the history
+ improvements in big numbers
+ PLN currency added
+reformat flake8
+small correction in RU
  • Loading branch information
SkiBY committed May 6, 2024
1 parent 033d371 commit f3e5ddc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions num2words/lang_BE.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class Num2Word_BE(Num2Word_Base):
("капейка", "капейкі", "капеек"),
),
"UZS": (("сум", "сумы", "сумаў"), ("тыйін", "тыйіны", "тыйінаў")),
"PLN": (("злоты", "злотых", "злотых"), ("грош", "грошы", "грошаў")),
}

def setup(self):
Expand Down
15 changes: 15 additions & 0 deletions tests/test_be.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,3 +383,18 @@ def test_to_currency(self):
),
"сто адзін сум і дваццаць два тыйіны",
)

self.assertEqual(
num2words(1.0, lang="be", to="currency", currency="PLN"),
"адзін злоты, нуль грошаў",
)

self.assertEqual(
num2words(23.40, lang="be", to="currency", currency="PLN"),
"дваццаць тры злотых, сорак грошаў",
)

self.assertEqual(
num2words(9999.39, lang="be", to="currency", currency="PLN"),
"дзевяць тысяч дзевяцьсот дзевяноста дзевяць злотых, трыццаць дзевяць грошаў",
)

0 comments on commit f3e5ddc

Please sign in to comment.