diff options
| author | Iain R. Learmonth <irl@fsfe.org> | 2017-04-22 16:21:53 +0100 |
|---|---|---|
| committer | Iain R. Learmonth <irl@fsfe.org> | 2017-04-22 16:21:53 +0100 |
| commit | a2b3f23f0212a16ae410d513749b535fdbe6bc5a (patch) | |
| tree | 5cf5984009e9924f4609c414c0bd5dbec8692273 | |
| parent | ac485a5028de97112edcf3d032a6a65cf1f864ed (diff) | |
Switch to using KiB/MiB instead of kB/MB to match tor
The Tor client uses 1024 bytes per "KBytes" in the torrc, but Atlas was using
1000. This also replaces units with the binary prefixed version.
Closes: #21822
| -rw-r--r-- | js/helpers.js | 8 | ||||
| -rw-r--r-- | templates/search/do.html | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/js/helpers.js b/js/helpers.js index 0d50709..583a302 100644 --- a/js/helpers.js +++ b/js/helpers.js @@ -249,13 +249,13 @@ var CountryCodes = { } function hrBandwidth(bw) { - var bw_k = bw/1000; - var bw_m = bw_k/1000; + var bw_k = bw/1024; + var bw_m = bw_k/1024; if (bw_m >= 1) { - return Math.round(bw_m * 100) / 100 + " MB/s"; + return Math.round(bw_m * 100) / 100 + " MiB/s"; } else if (bw_k >= 1) { - return Math.round(bw_k * 100) / 100 + " KB/s"; + return Math.round(bw_k * 100) / 100 + " KiB/s"; } return bw + " B/s"; diff --git a/templates/search/do.html b/templates/search/do.html index 51a2d82..7122ede 100644 --- a/templates/search/do.html +++ b/templates/search/do.html @@ -131,7 +131,7 @@ <input type="text" id="nickname" name="nickname" placeholder="Nickname" class="search_init"> </th> <th> - <input type="text" id="bw_from" name="bw_from" placeholder="From (KB/s)" class="search_init span1"><input type="text" id="bw_to"name="bw_to" placeholder="To (KB/s)" class="search_init span1"> + <input type="text" id="bw_from" name="bw_from" placeholder="From (KiB/s)" class="search_init span1"><input type="text" id="bw_to"name="bw_to" placeholder="To (KiB/s)" class="search_init span1"> </th> <th> <input type="text" id="uptime_from" name="uptime_from" placeholder="From (days)" class="search_init span1"> |
