mirror of
https://github.com/bblaz/num2words.git
synced 2025-12-06 06:42:25 +00:00
feat(Num2Word_EU): add MX to CURRENCY_FORMS (#187)
* lang_EU: add MX to CURRENCY_FORMS and CURRENCY_ADJETIVES
This commit is contained in:
committed by
Ernesto Rodriguez Ortiz
parent
26a2204f3b
commit
424cf9fda8
@@ -40,6 +40,7 @@ class Num2Word_EU(Num2Word_Base):
|
|||||||
'SEK': (('krona', 'kronor'), ('öre', 'öre')),
|
'SEK': (('krona', 'kronor'), ('öre', 'öre')),
|
||||||
'NOK': (('krone', 'kroner'), ('øre', 'øre')),
|
'NOK': (('krone', 'kroner'), ('øre', 'øre')),
|
||||||
'PLN': (('zloty', 'zlotys', 'zlotu'), ('grosz', 'groszy')),
|
'PLN': (('zloty', 'zlotys', 'zlotu'), ('grosz', 'groszy')),
|
||||||
|
'MXN': (('peso', 'pesos'), GENERIC_CENTS),
|
||||||
}
|
}
|
||||||
|
|
||||||
CURRENCY_ADJECTIVES = {
|
CURRENCY_ADJECTIVES = {
|
||||||
@@ -49,6 +50,7 @@ class Num2Word_EU(Num2Word_Base):
|
|||||||
'USD': 'US',
|
'USD': 'US',
|
||||||
'RUB': 'Russian',
|
'RUB': 'Russian',
|
||||||
'NOK': 'Norwegian',
|
'NOK': 'Norwegian',
|
||||||
|
'MXN': 'Mexican',
|
||||||
}
|
}
|
||||||
|
|
||||||
GIGA_SUFFIX = "illiard"
|
GIGA_SUFFIX = "illiard"
|
||||||
|
|||||||
@@ -97,6 +97,30 @@ class Num2WordsENTest(TestCase):
|
|||||||
'four thousand, seven hundred and seventy-eight dollars and'
|
'four thousand, seven hundred and seventy-eight dollars and'
|
||||||
' zero cents')
|
' zero cents')
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
num2words('1.1', lang='en', to='currency', seperator=' and',
|
||||||
|
cents=True, currency='MXN'),
|
||||||
|
"one peso and ten cents"
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
num2words('158.3', lang='en', to='currency', seperator=' and',
|
||||||
|
cents=True, currency='MXN'),
|
||||||
|
"one hundred and fifty-eight pesos and thirty cents"
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
num2words('2000.00', lang='en', to='currency', seperator=' and',
|
||||||
|
cents=True, currency='MXN'),
|
||||||
|
"two thousand pesos and zero cents"
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
num2words('4.01', lang='en', to='currency', seperator=' and',
|
||||||
|
cents=True, currency='MXN'),
|
||||||
|
"four pesos and one cent"
|
||||||
|
)
|
||||||
|
|
||||||
def test_to_year(self):
|
def test_to_year(self):
|
||||||
# issue 141
|
# issue 141
|
||||||
# "e2 e2"
|
# "e2 e2"
|
||||||
|
|||||||
Reference in New Issue
Block a user