Show totals to three decimals
Browse files- index.html +7 -2
index.html
CHANGED
|
@@ -221,7 +221,9 @@
|
|
| 221 |
tr.tier2{opacity:.62}
|
| 222 |
.rk{width:58px;color:var(--muted);font-weight:700;white-space:nowrap}
|
| 223 |
.rk.top{color:var(--accent);font-size:15px}
|
|
|
|
| 224 |
.rk .rkscore{display:block;margin-top:2px;font-size:10.5px;font-weight:800;
|
|
|
|
| 225 |
color:var(--ink);letter-spacing:0}
|
| 226 |
.cid{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12.5px;font-weight:600}
|
| 227 |
.skel{color:#93a1b5;font-size:11px;font-family:ui-monospace,monospace}
|
|
@@ -684,6 +686,9 @@ let DATA = null, sortKey = "total", sortDir = -1;
|
|
| 684 |
|
| 685 |
const $ = s => document.querySelector(s);
|
| 686 |
const f1 = v => (v==null||v==="") ? "–" : (+v).toFixed(1);
|
|
|
|
|
|
|
|
|
|
| 687 |
const t = () => T[LANG];
|
| 688 |
const submittedDate = e => {
|
| 689 |
if(e.is_anchor || !e.submitted_at) return "–";
|
|
@@ -798,13 +803,13 @@ function render(){
|
|
| 798 |
const tag = e.is_anchor ? `<span class="tag a">${d.anchor}</span>`
|
| 799 |
: (e.tier===2 ? `<span class="tag r">${d.relegated}</span>` : "");
|
| 800 |
const rk = e.rank==null ? "—"
|
| 801 |
-
: `#${e.rank}<span class="rkscore">${
|
| 802 |
return `<tr class="${cls}">
|
| 803 |
<td class="rk ${e.rank===1?"top":""}">${rk}</td>
|
| 804 |
<td>${id}${tag}</td><td>${user}</td><td>${who}</td><td>${submittedDate(e)}</td>
|
| 805 |
${AX.map(k=>`<td>${f1(a[k])}</td>`).join("")}
|
| 806 |
<td><div class="barwrap"><span class="bar"><i style="width:${Math.max(2,(e.total||0)/max*100)}%"></i></span>
|
| 807 |
-
<span class="tot">${
|
| 808 |
}).join("") : `<tr><td colspan="12" class="who">${d.empty}</td></tr>`;
|
| 809 |
|
| 810 |
wireCopy($("#rows"));
|
|
|
|
| 221 |
tr.tier2{opacity:.62}
|
| 222 |
.rk{width:58px;color:var(--muted);font-weight:700;white-space:nowrap}
|
| 223 |
.rk.top{color:var(--accent);font-size:15px}
|
| 224 |
+
.tot{font-variant-numeric:tabular-nums}
|
| 225 |
.rk .rkscore{display:block;margin-top:2px;font-size:10.5px;font-weight:800;
|
| 226 |
+
font-variant-numeric:tabular-nums;
|
| 227 |
color:var(--ink);letter-spacing:0}
|
| 228 |
.cid{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12.5px;font-weight:600}
|
| 229 |
.skel{color:#93a1b5;font-size:11px;font-family:ui-monospace,monospace}
|
|
|
|
| 686 |
|
| 687 |
const $ = s => document.querySelector(s);
|
| 688 |
const f1 = v => (v==null||v==="") ? "–" : (+v).toFixed(1);
|
| 689 |
+
// totals carry three decimals; the per-axis columns stay at one, where the extra digits
|
| 690 |
+
// would be width without information
|
| 691 |
+
const f3 = v => (v==null||v==="") ? "–" : (+v).toFixed(3);
|
| 692 |
const t = () => T[LANG];
|
| 693 |
const submittedDate = e => {
|
| 694 |
if(e.is_anchor || !e.submitted_at) return "–";
|
|
|
|
| 803 |
const tag = e.is_anchor ? `<span class="tag a">${d.anchor}</span>`
|
| 804 |
: (e.tier===2 ? `<span class="tag r">${d.relegated}</span>` : "");
|
| 805 |
const rk = e.rank==null ? "—"
|
| 806 |
+
: `#${e.rank}<span class="rkscore">${f3(e.total)}${LANG==="ko"?"점":" pts"}</span>`;
|
| 807 |
return `<tr class="${cls}">
|
| 808 |
<td class="rk ${e.rank===1?"top":""}">${rk}</td>
|
| 809 |
<td>${id}${tag}</td><td>${user}</td><td>${who}</td><td>${submittedDate(e)}</td>
|
| 810 |
${AX.map(k=>`<td>${f1(a[k])}</td>`).join("")}
|
| 811 |
<td><div class="barwrap"><span class="bar"><i style="width:${Math.max(2,(e.total||0)/max*100)}%"></i></span>
|
| 812 |
+
<span class="tot">${f3(e.total)}</span></div></td></tr>`;
|
| 813 |
}).join("") : `<tr><td colspan="12" class="who">${d.empty}</td></tr>`;
|
| 814 |
|
| 815 |
wireCopy($("#rows"));
|