From ce5979241943afa54c3051c445e7c7679bc9244b Mon Sep 17 00:00:00 2001 From: phzhik Date: Sun, 27 Aug 2023 18:07:40 +0400 Subject: [PATCH] * Preview image: format price by 3 digits with spaces --- store/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/store/utils.py b/store/utils.py index 2ab9c86..0388d47 100644 --- a/store/utils.py +++ b/store/utils.py @@ -97,7 +97,9 @@ def create_preview(source_image: str, size=None, price_rub=None, title_lines=Non # Draw price if price_rub: - price_text = f"{int(price_rub)} ₽" + # Format price as '1 000 000' string (by 3 digits with spaces) + price_text = format(int(price_rub), ',').replace(',', ' ') + price_text = f"{price_text} ₽" price_font = get_font(50) price_x, price_y = hor_padding + 15, preview_height - 100