From ad9691cf051c205c992064ab9d6c46c2aba79dd6 Mon Sep 17 00:00:00 2001 From: unwox Date: Tue, 5 Nov 2024 13:51:12 +0600 Subject: improve price formatting --- bin/serve.fnl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/serve.fnl b/bin/serve.fnl index 884fb4f..06ecd22 100644 --- a/bin/serve.fnl +++ b/bin/serve.fnl @@ -299,14 +299,15 @@ [:a {:href link :style "text-decoration: none;" :rel "nofollow"} [:NO-ESCAPE (.. "

" (unescape product.title) "

")]] [:div {:class "price"} - (if product.price (.. product.price "₽") "") + (if product.price (.. (str.format-price product.price) "₽") "") (if (< 0 product.weight) [:NO-ESCAPE (.. "за " product.weight " гр.")] "") (if (and (< 1 product.weight) product.price-per (< 0 product.price-per)) - [:NO-ESCAPE (.. " (" product.price-per "₽ за 1 гр.)")] + [:NO-ESCAPE (.. "
(" (str.format-price product.price-per) + "₽ за 1 гр.)")] "")]]) (fn paginator-template [form page limit total] -- cgit v1.2.3