aboutsummaryrefslogtreecommitdiff
path: root/scripts/_stats-script.js
blob: 43b795ee1e42b967a10280322be2ae99d7bdad94 (plain)
1
2
3
4
5
6
7
8
9
updateSubTotal(); // Initial call

function updateSubTotal() {
  var table = document.getElementById("myTable");
  let subTotal = Array.from(table.rows).slice(1).reduce((total, row) => {
    return total + parseFloat(row.cells[1].innerHTML);
  }, 0);
  document.getElementById("val").innerHTML = "SubTotal =" + (subTotal.toFixed(2) / 742);
}