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

View File

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