Skip to content

Commit

Permalink
Add yen (JPY) and won (KRW) for European languages
Browse files Browse the repository at this point in the history
  • Loading branch information
bryananderson committed Dec 15, 2024
1 parent 0df2a0e commit 7423f2a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 6 additions & 2 deletions num2words/lang_EU.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class Num2Word_EU(Num2Word_Base):
'HUF': (('forint', 'forint'), ('fillér', 'fillér')),
'ISK': (('króna', 'krónur'), ('aur', 'aurar')),
'UZS': (('sum', 'sums'), ('tiyin', 'tiyins')),
'SAR': (('saudi riyal', 'saudi riyals'), ('halalah', 'halalas'))
'SAR': (('saudi riyal', 'saudi riyals'), ('halalah', 'halalas')),
'JPY': (('yen', 'yen'), ('sen', 'sen'),
'KRW': (('won', 'won'), ('jeon', 'jeon'),

}

Expand All @@ -65,7 +67,9 @@ class Num2Word_EU(Num2Word_Base):
'HUF': 'Hungarian',
'ISK': 'íslenskar',
'UZS': 'Uzbekistan',
'SAR': 'Saudi'
'SAR': 'Saudi',
'JPY': 'Japanese',
'KRW': 'Korean',
}

GIGA_SUFFIX = "illiard"
Expand Down
12 changes: 12 additions & 0 deletions tests/test_en.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ def test_to_currency(self):
"two thousand sums and zero tiyins"
)

self.assertEqual(
num2words('2000.00', lang='en', to='currency', separator=' and',
cents=True, currency='JPY'),
"two thousand yen and zero sen"
)

self.assertEqual(
num2words('2000.00', lang='en', to='currency', separator=' and',
cents=True, currency='KRW'),
"two thousand won and zero jeon"
)

def test_to_year(self):
# issue 141
# "e2 e2"
Expand Down

0 comments on commit 7423f2a

Please sign in to comment.