mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
* Refs #99 -- Fix stripe support for zero-decimal currencies * Add new money formatting method * Force decimal places in many places * Locale-aware currency rendering * Fix currencies in more places * More currency fixes
This commit is contained in:
@@ -12,6 +12,8 @@ from i18nfield.forms import I18nFormField # noqa
|
||||
from i18nfield.strings import LazyI18nString # noqa
|
||||
from i18nfield.utils import I18nJSONEncoder # noqa
|
||||
|
||||
from pretix.base.templatetags.money import money_filter
|
||||
|
||||
|
||||
class LazyDate:
|
||||
def __init__(self, value):
|
||||
@@ -24,6 +26,18 @@ class LazyDate:
|
||||
return date_format(self.value, "SHORT_DATE_FORMAT")
|
||||
|
||||
|
||||
class LazyCurrencyNumber:
|
||||
def __init__(self, value, currency):
|
||||
self.value = value
|
||||
self.currency = currency
|
||||
|
||||
def __format__(self, format_spec):
|
||||
return self.__str__()
|
||||
|
||||
def __str__(self):
|
||||
return money_filter(self.value, self.currency)
|
||||
|
||||
|
||||
class LazyNumber:
|
||||
def __init__(self, value, decimal_pos=2):
|
||||
self.value = value
|
||||
|
||||
Reference in New Issue
Block a user