lang_es: Add currency PEN (#200)

This commit is contained in:
Jose Carlos
2018-10-13 18:29:58 -05:00
committed by Ernesto Rodriguez Ortiz
parent 424cf9fda8
commit dc733cfa1b
2 changed files with 19 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ class Num2Word_ES(Num2Word_EU):
'EUR': (('euro', 'euros'), ('centimo', 'centimos')),
'ESP': (('peseta', 'pesetas'), ('centimo', 'centimos')),
'USD': (('dolar', 'dolares'), ('centavo', 'centavos')),
'PEN': (('sol', 'soles'), ('centimo', 'centimos')),
}
# //CHECK: Is this sufficient??

View File

@@ -142,6 +142,17 @@ TEST_CASES_TO_CURRENCY_USD = (
(100.00, 'cien dolares con cero centavos'),
)
TEST_CASES_TO_CURRENCY_PEN = (
(1.00, 'un sol con cero centimos'),
(2.00, 'dos soles con cero centimos'),
(8.00, 'ocho soles con cero centimos'),
(12.00, 'doce soles con cero centimos'),
(21.00, 'veintiun soles con cero centimos'),
(81.25, 'ochenta y un soles con veinticinco centimos'),
(350.90, 'trescientos cincuenta soles con noventa centimos'),
(100.00, 'cien soles con cero centimos'),
)
class Num2WordsESTest(TestCase):
@@ -183,3 +194,10 @@ class Num2WordsESTest(TestCase):
num2words(test[0], lang='es', to='currency', currency='USD'),
test[1]
)
def test_currency_pen(self):
for test in TEST_CASES_TO_CURRENCY_PEN:
self.assertEqual(
num2words(test[0], lang='es', to='currency', currency='PEN'),
test[1]
)