Skip to content

Commit

Permalink
Add USD currency support to RU language (#211)
Browse files Browse the repository at this point in the history
* Add USD currency support to RU language
  • Loading branch information
MontakOleg authored and erozqba committed Oct 14, 2018
1 parent dc733cf commit 9a31d90
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions num2words/lang_RU.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ class Num2Word_RU(Num2Word_Base):
'EUR': (
('евро', 'евро', 'евро'), ('цент', 'цента', 'центов')
),
'USD': (
('доллар', 'доллара', 'долларов'), ('цент', 'цента', 'центов')
),
}

def setup(self):
Expand Down
13 changes: 13 additions & 0 deletions tests/test_ru.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,16 @@ def test_to_currency(self):
cents=False, currency='EUR'),
"тридцать восемь евро и 40 центов"
)
self.assertEqual(
num2words('1230.56', lang='ru', to='currency', currency='USD'),
'одна тысяча двести тридцать долларов, пятьдесят шесть центов'
)
self.assertEqual(
num2words('1231.56', lang='ru', to='currency', currency='USD'),
'одна тысяча двести тридцать один доллар, пятьдесят шесть центов'
)
self.assertEqual(
num2words('1234.56', lang='ru', to='currency', currency='USD'),
'одна тысяча двести тридцать четыре доллара, пятьдесят шесть '
'центов'
)

0 comments on commit 9a31d90

Please sign in to comment.