Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this is the function that finds the worst throw
- dMin = function() {
- var dtotal = 0;
- var output1 = document.getElementById("dOutMin");
- let min = myData[0][0];
- for(var r = 0; r < myData.length; r++) {
- for (let c = 0; c < myData[r].length; c++) {
- if (isNaN(Number(myData[r][c]))) {
- //console.log(myData[r][c])
- } else {
- if(myData[r][c] < min) {
- min = Number(myData[r][c]);
- }
- }
- //dTotal += dThrows[d];
- } // end for
- var outmin = min;
- document.getElementById("dOutMin").innerHTML = "Caleb's worst weight throw of the season was : " + outmin.toFixed(2) + " meters";
- };
- };
- /*
- </script>
- <hr>
- <button type="button" onclick = dtfun()>Weight Throw Average Distance</button>
- <p id = "out1"></p>
- <hr>
- <button type="button" onclick = dMax()>Weight Season Best</button>
- <p id = "dOutMax"></p>
- <hr>
- <button type = "button" onclick = dMin()>Weight Throw Season Worst</button>
- <p id = "dOutMin"></p>
- <hr>
- <button type = "button" onclick = dttotal()>Total Distance Thrown with Weight</button>
- <p id = "dOutTotal"></p>
- <hr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement