From 73594a910182176d2810c2fb1d2033abc6402456 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 11 May 2023 17:30:05 +0200 Subject: [PATCH] Fix some N/A displays in the viewer. --- ultimate.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ultimate.js b/ultimate.js index 7fbfa17..10f8fac 100644 --- a/ultimate.js +++ b/ultimate.js @@ -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); -- 2.39.2