Advertisement
RodrigoOrnelas

value a partir de uma matriz items

Jul 29th, 2023
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.31 KB | Source Code | 0 0
  1. function calculateTotalValue() {
  2.   var products = {{0.20 - [🕹ī¸] Matriz items (search)}}; //substitua por sua matriz items
  3.   var total = 0;
  4.  
  5.   for (var i = 0; i < products.length; i++) {
  6.     var indice = products[i];
  7.     total =total + (indice.price * indice.quantity);
  8.   }
  9.  
  10.   return total.toFixed(2);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement