# Path: konfera/utils.py
# def currency_round_up(money):
#     return money.quantize(Decimal('1.00'), rounding=ROUND_UP)
# 
# Path: konfera/settings.py
# CURRENCY = getattr(settings, 'CURRENCY', ('€', 'EUR'))


from django import template
from konfera.utils import currency_round_up
from konfera.settings import CURRENCY


register = template.Library()


@register.filter(name='addcss')
def addcss(field, css):
    return field.as_widget(attrs={"class": css})


@register.filter
def currency(value):
    return '%s %s' % (currency_round_up(value), CURRENCY[0])


@register.filter
def currency_code(value):

# Path: konfera/utils.py
# def currency_round_up(money):
#     return money.quantize(Decimal('1.00'), rounding=ROUND_UP)
# 
# Path: konfera/settings.py
# CURRENCY = getattr(settings, 'CURRENCY', ('€', 'EUR'))


# Path: konfera/templatetags/custom_filters.py
from django import template
from konfera.utils import currency_round_up
from konfera.settings import CURRENCY



register = template.Library()


@register.filter(name='addcss')
def addcss(field, css):
    return field.as_widget(attrs={"class": css})


@register.filter
def currency(value):
    return '%s %s' % (currency_round_up(value), CURRENCY[0])


@register.filter
def currency_code(value):

    return '%s %s' % (currency_round_up(value), CURRENCY[1])