Add Amharic currency form

This commit is contained in:
Eyosiyas Bereketab
2022-08-07 23:02:25 +03:00
parent 47d63acabf
commit d1a85b315a

View File

@@ -21,6 +21,8 @@ from . import lang_EU
class Num2Word_AM(lang_EU.Num2Word_EU): class Num2Word_AM(lang_EU.Num2Word_EU):
CURRENCY_FORMS = {'ETB': (('ብር', 'ብር'), ('ሳንቲም', 'ሳንቲም'))}
def set_high_numwords(self, high): def set_high_numwords(self, high):
max = 3 + 3 * len(high) max = 3 + 3 * len(high)
for word, n in zip(high, range(max, 3, -3)): for word, n in zip(high, range(max, 3, -3)):
@@ -93,8 +95,8 @@ class Num2Word_AM(lang_EU.Num2Word_EU):
self.verify_ordinal(value) self.verify_ordinal(value)
return "%s%s" % (value, self.to_ordinal(value)[-2:]) return "%s%s" % (value, self.to_ordinal(value)[-2:])
def to_currency(self, val, currency='ብር', cents=True, separator='.', def to_currency(self, val, currency='ብር', cents=True, separator='',
adjective=False): adjective=True):
result = super(Num2Word_AM, self).to_currency( result = super(Num2Word_AM, self).to_currency(
val, currency=currency, cents=cents, separator=separator, val, currency=currency, cents=cents, separator=separator,
adjective=adjective) adjective=adjective)