refactor: show plus signs

This commit is contained in:
Barış Soner Uşaklı
2026-02-27 18:47:10 -05:00
parent eab26dc4cc
commit c85e464b14
2 changed files with 7 additions and 9 deletions

View File

@@ -227,7 +227,7 @@ function calculateDeltas(results) {
function increasePercent(last, now) {
const percent = last ? (now - last) / last * 100 : 0;
return percent.toFixed(0);
return (percent > 0 ? `+` : '') + percent.toFixed(0);
}
results.yesterday -= results.today;
results.dayIncrease = increasePercent(results.yesterday, results.today);

View File

@@ -20,14 +20,12 @@
<tbody class="text-sm text-tabular">
{{{ each stats }}}
<tr>
<td class="fw-bold text-nowrap">
{{{ if ./href }}}
<a href="{./href}">{./name}</a>
{{{ else }}}
{./name}
{{{ end }}}
<td class="fw-semibold text-nowrap">
{{{ if ./href }}}
<a href="{./href}">{./name}</a>
{{{ else }}}
{./name}
{{{ end }}}
</td>
<td class="text-end">{formattedNumber(./yesterday)}</td>
<td class="text-end">{formattedNumber(./today)}</td>