]> git.sesse.net Git - pkanalytics/commitdiff
Fix some N/A displays in the viewer.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 11 May 2023 15:30:05 +0000 (17:30 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 11 May 2023 15:30:05 +0000 (17:30 +0200)
ultimate.js

index 7fbfa172bf3c189f1dfc9a379eb511d935ee28d3..10f8fac4632dc449c028773eb4ad80acdac188cd 100644 (file)
@@ -455,10 +455,18 @@ function make_table_offense(players) {
                add_cell(row, 'td', p.hockey_assists);
                add_cell(row, 'td', p.num_throws);
                add_cell(row, 'td', p.throwaways);
-               add_cell(row, 'td', throw_ok.toFixed(0) + '%');
+               if (p.num_throws > 0) {
+                       add_cell(row, 'td', throw_ok.toFixed(0) + '%');
+               } else {
+                       add_cell(row, 'td', 'N/A');
+               }
                add_cell(row, 'td', p.catches);
                add_cell(row, 'td', p.drops);
-               add_cell(row, 'td', catch_ok.toFixed(0) + '%');
+               if (p.catches + p.drops > 0) {
+                       add_cell(row, 'td', catch_ok.toFixed(0) + '%');
+               } else {
+                       add_cell(row, 'td', 'N/A');
+               }
                add_cell(row, 'td', '+' + p.offensive_soft_plus);
                add_cell(row, 'td', '-' + p.offensive_soft_minus);
                rows.push(row);