Advertisement
Guest User

Worst

a guest
Apr 24th, 2019
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. //this is the function that finds the worst throw
  2. dMin = function() {
  3. var dtotal = 0;
  4. var output1 = document.getElementById("dOutMin");
  5. let min = myData[0][0];
  6. for(var r = 0; r < myData.length; r++) {
  7. for (let c = 0; c < myData[r].length; c++) {
  8. if (isNaN(Number(myData[r][c]))) {
  9. //console.log(myData[r][c])
  10. } else {
  11. if(myData[r][c] < min) {
  12. min = Number(myData[r][c]);
  13. }
  14. }
  15. //dTotal += dThrows[d];
  16. } // end for
  17. var outmin = min;
  18. document.getElementById("dOutMin").innerHTML = "Caleb's worst weight throw of the season was : " + outmin.toFixed(2) + " meters";
  19. };
  20. };
  21.  
  22. /*
  23. </script>
  24. <hr>
  25. <button type="button" onclick = dtfun()>Weight Throw Average Distance</button>
  26. <p id = "out1"></p>
  27. <hr>
  28. <button type="button" onclick = dMax()>Weight Season Best</button>
  29. <p id = "dOutMax"></p>
  30. <hr>
  31. <button type = "button" onclick = dMin()>Weight Throw Season Worst</button>
  32. <p id = "dOutMin"></p>
  33. <hr>
  34. <button type = "button" onclick = dttotal()>Total Distance Thrown with Weight</button>
  35. <p id = "dOutTotal"></p>
  36.  
  37. <hr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement