Click here to Skip to main content
15,886,857 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
Hello Guys, How are you.I hope you will be fine guys I have started my new ionic project and the projects is working well but I have an issue with multiplication can you please guide me how can I sum 2 values in ionic and show in 3rd
<td>{{item.item_qty}}</td>

<td>{{item.product_price}}</td>

i want to multiply this 2 values and show in 3rd
Thanks

What I have tried:

<ion-view style="" class=" " id="page10" title="Orders">
    <ion-content class="has-header" padding="true">
 <ion-refresher
    pulling-text="Pull to refresh..."
    on-refresh="doRefresh()">
  </ion-refresher>
        <style>
table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    text-align: left;
    padding: 8px;
}

tr:nth-child(even){background-color: #f2f2f2}

th {
    background-color: #4CAF50;
    color: white;
}
</style>
        <div style="overflow-x:auto;">
     <table>
  <thead>
    <tr>
      <th width="200">Product Qty</th>
      <th>Product Name</th>
      <th width="150">Status</th>
      <th width="150">Total</th>
    </tr>
  </thead>
  <tbody>
    <tr ng-repeat="item in orders" class="animated fadeInUp">
      <td>{{item.item_qty}}</td>
      <td>{{item.product_name}}</td>
      <td>{{item.status}}</td>
      <td>{{item7.product_price}}</td>
    </tr>
  </tbody>
</table>
</div>

    </ion-content>
</ion-view>
Posted
Updated 21-Jun-17 13:40pm
v3

1 solution

In your code i see this line
<td>{{item7.product_price}}</td>
it has 7 number remove that and you can write below code to multiply:
<td>{{item.item_qty * item.product_price}}</td>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900