Jump to content

Округление цены к целым числам

Recommended Posts

Я знаю только как округлять все :)

<!-- Цена /-->

{if $product->variants[0]->discount_price>0}
<span id=variant_price_{$product->product_id}>{$product->variants[0]->discount_price*$currency->rate_from/$currency->rate_to|string_format:"%.0f"}</span> {$currency->sign|escape}

так вроде :)

Link to post
Share on other sites
  • 1 month later...
  • 3 weeks later...
  • 2 years later...
  • 2 years later...
  • 6 years later...

А как в выгрузку Яндекса сделать, чтобы без копеек округленно попадало? По умолчанию там:

$price = round($simpla->money->convert($p->price, $main_currency->id, false),2);


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...