Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(46)  |  Call(31)  |  Derive(0)  |  Import(15)
Format decimal value as currency

        @register.filter(name='currency')
def currency(value, currency=None):
    """
    Format decimal value as currency
    """
    try:
        value = D(value)
    except (TypeError, InvalidOperation):
        return u""
    # Using Babel's currency formatting
    # http://babel.pocoo.org/docs/api/numbers/#babel.numbers.format_currency
    kwargs = {
        'currency': currency if currency else settings.OSCAR_DEFAULT_CURRENCY,
        'format': getattr(settings, 'OSCAR_CURRENCY_FORMAT', None),
    }
    locale = getattr(settings, 'OSCAR_CURRENCY_LOCALE', None)
    if locale:
        kwargs['locale'] = locale

    return format_currency(value, **kwargs)
        


src/d/j/django-oscar-0.7/oscar/apps/offer/models.py   django-oscar(Download)
from oscar.core.loading import get_class
from oscar.apps.offer.managers import ActiveOfferManager
from oscar.templatetags.currency_filters import currency
from oscar.models import fields
 
        if self.max_discount:
            desc = _("Limited to a cost of %(max)s") % {
                'max': currency(self.max_discount)}
            restrictions.append({
                'description': desc,
    def name(self):
        return self._description % {
            'amount': currency(self.value),
            'range': six.text_type(self.range).lower()}
 
    @property
    def description(self):
        return self._description % {
            'amount': currency(self.value),
    def get_upsell_message(self, offer, basket):
        value_of_matches = self._get_value_of_matches(offer, basket)
        return _('Spend %(value)s more from %(range)s') % {
            'value': currency(self.value - value_of_matches),
            'range': self.range}

src/d/j/django-oscar-HEAD/oscar/apps/offer/models.py   django-oscar(Download)
from oscar.core.loading import get_class, get_model
from oscar.apps.offer.managers import ActiveOfferManager
from oscar.templatetags.currency_filters import currency
from oscar.models import fields
 
        if self.max_discount:
            desc = _("Limited to a cost of %(max)s") % {
                'max': currency(self.max_discount)}
            restrictions.append({
                'description': desc,
    def name(self):
        return self._description % {
            'amount': currency(self.value),
            'range': six.text_type(self.range).lower()}
 
    @property
    def description(self):
        return self._description % {
            'amount': currency(self.value),
    def get_upsell_message(self, offer, basket):
        value_of_matches = self._get_value_of_matches(offer, basket)
        return _('Spend %(value)s more from %(range)s') % {
            'value': currency(self.value - value_of_matches),
            'range': self.range}

src/d/j/django-oscar-0.7/oscar/apps/basket/abstract_models.py   django-oscar(Download)
from oscar.apps.offer import results
from oscar.core.compat import AUTH_USER_MODEL
from oscar.templatetags.currency_filters import currency
 
 
            product_prices = {
                'product': self.product.get_title(),
                'old_price': currency(self.price_incl_tax),
                'new_price': currency(current_price_incl_tax)
            }

src/d/j/django-oscar-HEAD/oscar/apps/basket/abstract_models.py   django-oscar(Download)
from oscar.apps.offer import results
from oscar.core.compat import AUTH_USER_MODEL
from oscar.templatetags.currency_filters import currency
 
 
            product_prices = {
                'product': self.product.get_title(),
                'old_price': currency(self.price_incl_tax),
                'new_price': currency(current_price_incl_tax)
            }

src/d/j/django-account-balances-0.4/accounts/dashboard/views.py   django-account-balances(Download)
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from oscar.templatetags.currency_filters import currency
 
from accounts.dashboard import forms, reports
        else:
            messages.success(
                self.request, _("%s added to account") % currency(amount))
        return http.HttpResponseRedirect(reverse('accounts-detail',
                                                 kwargs={'pk': account.id}))

src/d/j/django-account-balances-0.4/accounts/dashboard/forms.py   django-account-balances(Download)
from django.db.models import get_model
 
from oscar.templatetags.currency_filters import currency
from accounts import codes, names
 
            raise forms.ValidationError(_(
                "The maximum permitted top-up amount is %s") % (
                    currency(max_amount)))
        return amt
 

src/d/j/django-account-balances-0.4/accounts/checkout/forms.py   django-account-balances(Download)
from django.utils.translation import ugettext_lazy as _
from django.db.models import get_model
from oscar.templatetags.currency_filters import currency
 
Account = get_model('accounts', 'Account')
            raise forms.ValidationError(_(
                "The maximum allocation is %s") % currency(
                    max_allocation))
        return amt
 

src/d/j/django-oscar-accounts-0.3/accounts/dashboard/views.py   django-oscar-accounts(Download)
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from oscar.templatetags.currency_filters import currency
 
from accounts.dashboard import forms, reports
        else:
            messages.success(
                self.request, _("%s added to account") % currency(amount))
        return http.HttpResponseRedirect(reverse('accounts-detail',
                                                 kwargs={'pk': account.id}))

src/d/j/django-oscar-accounts-0.3/accounts/dashboard/forms.py   django-oscar-accounts(Download)
from django.db.models import get_model
 
from oscar.templatetags.currency_filters import currency
from accounts import codes, names
 
            raise forms.ValidationError(_(
                "The maximum permitted top-up amount is %s") % (
                    currency(max_amount)))
        return amt
 

src/d/j/django-oscar-accounts-0.3/accounts/checkout/forms.py   django-oscar-accounts(Download)
from django.utils.translation import ugettext_lazy as _
from django.db.models import get_model
from oscar.templatetags.currency_filters import currency
 
Account = get_model('accounts', 'Account')
            raise forms.ValidationError(_(
                "The maximum allocation is %s") % currency(
                    max_allocation))
        return amt
 

  1 | 2  Next