Leave a message in this thread and the user's contacts will be shown to you
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!
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!
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
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
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
Donate
You don't have enough funds in your account Top up