A
A
Artem2018-07-11 10:19:02
1C-Bitrix
Artem, 2018-07-11 10:19:02

How to remove decimals when displaying discounts?

Good day.
There are 2 components sale.basket.basket and sale.basket.basket.line
The basket displays a 14% discount, and in the basket line it looks like this: 13.964%.
Can anyone tell me how to remove the decimal places? Or maybe the conclusion is not correct.
5b45af4162c16688501517.png
In sale.basket.basket.line I output it like this.
" class="discount_percent">
<?=$v["DISCOUNT_PRICE_PERCENT_FORMATED"]?>
"
5b45af46b6c36148430202.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2018-07-11
@Tostic

<? echo  round ($v ["DISCOUNT_PRICE_PERCENT_FORMATED"])?>%

All the solution was found, it was just necessary to put round
5b45cfdb1e817054023177.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question