diff --git a/num2words/lang_ES.py b/num2words/lang_ES.py index 99f1ec0..d370f91 100644 --- a/num2words/lang_ES.py +++ b/num2words/lang_ES.py @@ -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?? diff --git a/tests/test_es.py b/tests/test_es.py index d905bac..43a5179 100644 --- a/tests/test_es.py +++ b/tests/test_es.py @@ -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] + )