Skip to content

Commit

Permalink
show two decimal places for packet loss percent
Browse files Browse the repository at this point in the history
fixes #25 (thanks @ELC for suggestion)
  • Loading branch information
benhansen-io committed Jul 1, 2024
1 parent 8d7a16e commit 16defdb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h3>Web Pings</h3>
>n/a
</span>
<a class="labeled-detail" href="/about#packetloss" target="_blank">Packet Loss</a
>:&nbsp;<span id="packetLoss">0% </span>
>:&nbsp;<span id="packetLoss">0.00% </span>
</div>
<div id="pingChart">
<div id="secondLabels" class="row">
Expand Down
2 changes: 1 addition & 1 deletion frontend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function updatePacketLossSpan() {
if (total == 0) {
return;
}
const percent = Math.round((numTimeoutPings / total) * 100);
const percent = ((numTimeoutPings / total) * 100).toFixed(2);
packetLossSpan.innerHTML = String(percent) + "%";
}

Expand Down

0 comments on commit 16defdb

Please sign in to comment.