1b.app
Link copied -

Output of quantities without thousands

Good day!
To confirm the order, I use the following code to display the list and quantity of the product:
{|foreach from=$basketsArray item="b"|}
{|$b.name|} - {|$b.count|} pcs.
{|/foreach|}
But there are two questions, because people get confused and complain, because when I output the quantity, I get three zeros after the period, example:
Product name - 700,000 pcs.
How can you remove these thousandths and output a whole number?
The second question is how to add item numbering to this formula?
Thank you!
Original question is available on version: ua

Answers:

Good afternoon. You can try using the following code:
{|assign var=n value=1|}
{|foreach from=$basketsArray item="b"|}
№{|$n|} {|$b.name|} - {|$b.count|number_format:2:".":""|} pcs.
{|assign var=n value=`$n+1`|}
{|/foreach|}
{|$n|} - for numbering in the list
|number_format:2:".":"" - to specify the number format, 2 - two numbers after the comma, for an integer value you can write 0
13.09.2023, 10:02
Original comment available on version: ua

Пчолкін Віталій
ІнваФішки, консультант
Thank you, just what you need!
15.09.2023, 01:58
Original comment available on version: ua

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment