diff --git a/templates/modals/full_calc.html b/templates/modals/full_calc.html index ae4df1b..ef1952e 100644 --- a/templates/modals/full_calc.html +++ b/templates/modals/full_calc.html @@ -169,10 +169,13 @@ oppAvgScore.innerText = oppAvg.toFixed(2); if (!isNaN(homeAvg) && !isNaN(oppAvg)) { const diff = (((homeAvg / oppAvg) - 1.0) * 100).toFixed(1); - if (diff > 0) - diffScore.classList.replace('text-warning', 'text-success'); - else if (diff < 0) - diffScore.classList.replace('text-warning', 'text-danger'); + diffScore.classList.remove('text-warning'); + diffScore.classList.remove('text-success'); + diffScore.classList.remove('text-danger'); + if (diff > 0.0) + diffScore.classList.add('text-success'); + else if (diff < 0.0) + diffScore.classList.add('text-danger'); diffScore.innerText = diff + "%"; }