Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# version 2.1 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA
from __future__ import unicode_literals
from .lang_FR import Num2Word_FR
class Num2Word_FR_DZ(Num2Word_FR):
CURRENCY_FORMS = {
'DIN': (('dinard', 'dinards'), ('centime', 'centimes')),
}
def to_currency(self, val, currency='DIN', cents=True, separator=' et',
adjective=False):
result = super(Num2Word_FR, self).to_currency(
val, currency=currency, cents=cents, separator=separator,
adjective=adjective)
return result
from __future__ import unicode_literals
from . import (lang_AR, lang_CZ, lang_DE, lang_DK, lang_EN, lang_EN_IN,
lang_ES, lang_ES_CO, lang_ES_NI, lang_ES_VE, lang_FI, lang_FR,
lang_FR_BE, lang_FR_CH, lang_FR_DZ, lang_HE, lang_HU, lang_ID,
lang_IT, lang_JA, lang_KN, lang_KO, lang_KZ, lang_LT, lang_LV,
lang_NL, lang_NO, lang_PL, lang_PT, lang_PT_BR, lang_RO,
lang_RU, lang_SL, lang_SR, lang_TE, lang_TH, lang_TR, lang_UK,
lang_VI)
CONVERTER_CLASSES = {
'ar': lang_AR.Num2Word_AR(),
'cz': lang_CZ.Num2Word_CZ(),
'en': lang_EN.Num2Word_EN(),
'en_IN': lang_EN_IN.Num2Word_EN_IN(),
'fr': lang_FR.Num2Word_FR(),
'fr_CH': lang_FR_CH.Num2Word_FR_CH(),
'fr_BE': lang_FR_BE.Num2Word_FR_BE(),
'fr_DZ': lang_FR_DZ.Num2Word_FR_DZ(),
'de': lang_DE.Num2Word_DE(),
'fi': lang_FI.Num2Word_FI(),
'es': lang_ES.Num2Word_ES(),
'es_CO': lang_ES_CO.Num2Word_ES_CO(),
'es_NI': lang_ES_NI.Num2Word_ES_NI(),
'es_VE': lang_ES_VE.Num2Word_ES_VE(),
'id': lang_ID.Num2Word_ID(),
'ja': lang_JA.Num2Word_JA(),
'kn': lang_KN.Num2Word_KN(),
'ko': lang_KO.Num2Word_KO(),
'kz': lang_KZ.Num2Word_KZ(),
'lt': lang_LT.Num2Word_LT(),
'lv': lang_LV.Num2Word_LV(),
def to_currency(self, val, currency='DIN', cents=True, separator=' et',
adjective=False):
result = super(Num2Word_FR, self).to_currency(
val, currency=currency, cents=cents, separator=separator,
adjective=adjective)
return result
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA
from __future__ import print_function, unicode_literals
from .lang_FR import Num2Word_FR
class Num2Word_FR_CH(Num2Word_FR):
def setup(self):
Num2Word_FR.setup(self)
self.mid_numwords = [(1000, "mille"), (100, "cent"), (90, "nonante"),
(80, "huitante"), (70, "septante"),
(60, "soixante"), (50, "cinquante"),
(40, "quarante"), (30, "trente")]
def merge(self, curr, next):
ctext, cnum, ntext, nnum = curr + next
if cnum == 1:
if nnum < 1000000:
return next
if cnum < 1000 and nnum != 1000 and\
def to_currency(self, val, currency='EUR', cents=True, separator=' et',
adjective=False):
result = super(Num2Word_FR, self).to_currency(
val, currency=currency, cents=cents, separator=separator,
adjective=adjective)
return result
# version 2.1 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA
from __future__ import print_function, unicode_literals
from .lang_FR import Num2Word_FR
class Num2Word_FR_BE(Num2Word_FR):
def setup(self):
Num2Word_FR.setup(self)
self.mid_numwords = [(1000, "mille"), (100, "cent"), (90, "nonante"),
(80, "quatre-vingt"), (70, "septante"),
(60, "soixante"), (50, "cinquante"),
(40, "quarante"), (30, "trente")]
def merge(self, curr, next):
ctext, cnum, ntext, nnum = curr + next
if cnum == 1:
if nnum < 1000000:
return next
if cnum < 1000 and nnum != 1000 and\