feat: explicit + prefix on positive P&L values (CVD accessibility)
Gain/loss no longer rides on green/red alone — red-green color vision deficiency affects ~8% of males; the minus sign already printed, now the plus does too. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
da17be8969
commit
81bf1540ef
1 file changed
+4
-1
@@ -690,7 +690,10 @@ const money = (v) => (v === null || v === undefined || isNaN(+v)) ? "—" : (v <
|
||||
const esc = (s) => String(s ?? "").replace(/[&<>"']/g, c => ({"&":"&","<":"<",">":">",'"':""","'":"'"}[c]));
|
||||
const timeOf = (ts) => { try { return new Date(ts).toLocaleTimeString(); } catch { return "—"; } };
|
||||
const signed = (el, v) => {
|
||||
el.textContent = (v === null || v === undefined || isNaN(+v)) ? "—" : money(v);
|
||||
// explicit "+" so gain/loss never rides on color alone (red-green CVD ~8% of
|
||||
// males; the minus already prints, the plus must too)
|
||||
el.textContent = (v === null || v === undefined || isNaN(+v)) ? "—"
|
||||
: (+v > 0 ? "+" : "") + money(v);
|
||||
el.className = "value num " + (+v > 0 ? "pos" : +v < 0 ? "neg" : "");
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user