consistently format prices everywhere
This commit is contained in:
@ -16,6 +16,7 @@ from common.components import (
|
||||
NameWithPlatformIcon,
|
||||
Popover,
|
||||
PopoverTruncated,
|
||||
PurchasePrice,
|
||||
)
|
||||
from common.time import (
|
||||
dateformat,
|
||||
@ -25,7 +26,7 @@ from common.time import (
|
||||
local_strftime,
|
||||
timeformat,
|
||||
)
|
||||
from common.utils import format_float_or_int, safe_division, truncate
|
||||
from common.utils import safe_division, truncate
|
||||
from games.forms import GameForm
|
||||
from games.models import Edition, Game, Purchase, Session
|
||||
from games.views.general import use_custom_redirect
|
||||
@ -247,7 +248,7 @@ def view_game(request: HttpRequest, game_id: int) -> HttpResponse:
|
||||
),
|
||||
purchase.get_type_display(),
|
||||
purchase.date_purchased.strftime(dateformat),
|
||||
f"{format_float_or_int(purchase.price)} {purchase.price_currency}",
|
||||
PurchasePrice(purchase),
|
||||
render_to_string(
|
||||
"cotton/button_group.html",
|
||||
{
|
||||
|
@ -13,9 +13,8 @@ from django.template.loader import render_to_string
|
||||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
|
||||
from common.components import A, Button, Icon, LinkedNameWithPlatformIcon
|
||||
from common.components import A, Button, Icon, LinkedNameWithPlatformIcon, PurchasePrice
|
||||
from common.time import dateformat
|
||||
from common.utils import format_float_or_int
|
||||
from games.forms import PurchaseForm
|
||||
from games.models import Edition, Purchase
|
||||
from games.views.general import use_custom_redirect
|
||||
@ -49,7 +48,6 @@ def list_purchases(request: HttpRequest) -> HttpResponse:
|
||||
"Name",
|
||||
"Type",
|
||||
"Price",
|
||||
"Currency",
|
||||
"Infinite",
|
||||
"Purchased",
|
||||
"Refunded",
|
||||
@ -66,8 +64,7 @@ def list_purchases(request: HttpRequest) -> HttpResponse:
|
||||
platform=purchase.platform,
|
||||
),
|
||||
purchase.get_type_display(),
|
||||
format_float_or_int(purchase.price),
|
||||
purchase.price_currency,
|
||||
PurchasePrice(purchase),
|
||||
purchase.infinite,
|
||||
purchase.date_purchased.strftime(dateformat),
|
||||
(
|
||||
|
Reference in New Issue
Block a user