* Preview image: format price by 3 digits with spaces

This commit is contained in:
Phil Zhitnikov 2023-08-27 18:07:40 +04:00
parent eeb4325e6b
commit ce59792419

View File

@ -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