|
@@ -226,7 +226,11 @@ function generateTables(rollstats: RollStats): void { |
|
|
let tb = $("#outcomeTable").find("tbody"); |
|
|
let tb = $("#outcomeTable").find("tbody"); |
|
|
let outcome: Outcomes = okeys[i] as Outcomes; |
|
|
let outcome: Outcomes = okeys[i] as Outcomes; |
|
|
let outcomeCount = rollstats.outcomeCounts[outcome]; |
|
|
let outcomeCount = rollstats.outcomeCounts[outcome]; |
|
|
let outcomePercent = (outcomeCount / rollstats.numRolls * 100).toFixed(2); |
|
|
|
|
|
|
|
|
let outcomePercent: string = ""; |
|
|
|
|
|
if (outcomeCount) { |
|
|
|
|
|
// Needed to avoid TS2532: |
|
|
|
|
|
outcomePercent = (outcomeCount / rollstats.numRolls * 100).toFixed(2); |
|
|
|
|
|
} |
|
|
tb.append(`<tr> <td>${outcome}</td> |
|
|
tb.append(`<tr> <td>${outcome}</td> |
|
|
<td>${outcomeCount}</td> |
|
|
<td>${outcomeCount}</td> |
|
|
<td>${outcomePercent}</td> |
|
|
<td>${outcomePercent}</td> |
|
|