Round decimal on dashboard

This commit is contained in:
Raphael Michel
2018-08-19 15:09:59 +02:00
parent 10c7d9a6e1
commit 625ef3da8a

View File

@@ -16,6 +16,7 @@ from django.utils.html import escape
from django.utils.timezone import now
from django.utils.translation import pgettext, ugettext_lazy as _, ungettext
from pretix.base.decimal import round_decimal
from pretix.base.models import (
Item, Order, OrderPosition, OrderRefund, RequiredAction, SubEvent, Voucher,
WaitingListEntry,
@@ -89,7 +90,7 @@ def base_widgets(sender, subevent=None, **kwargs):
},
{
'content': NUM_WIDGET.format(
num=formats.localize(rev), text=_('Total revenue ({currency})').format(currency=sender.currency)),
num=formats.localize(round_decimal(rev, sender.currency)), text=_('Total revenue ({currency})').format(currency=sender.currency)),
'display_size': 'small',
'priority': 100,
'url': reverse('control:event.orders.overview', kwargs={