Show a USD equivalent next to Earned below you
Server keeps an hourly-cached POL/USD spot price (CoinGecko, 8s timeout, last-known fallback) and rides it on the member API. The org bar adds a dollar tile with the rate it used; hidden when no price is known. Display-only - never used in on-chain math.
This commit is contained in:
@@ -92,6 +92,7 @@
|
||||
`<div class="fact" style="flex:1;min-width:110px"><small>Generations deep</small><strong style="font-size:22px">${gens}</strong></div>`+
|
||||
`<div class="fact" style="flex:1;min-width:110px"><small>Qualified below you</small><strong style="font-size:22px">${q}</strong></div>`+
|
||||
`<div class="fact" style="flex:1;min-width:140px"><small>Earned below you</small><strong style="font-size:22px;color:var(--ok)">${fmt(st.downPol)} POL</strong></div>`+
|
||||
(d.polUsd>0?`<div class="fact" style="flex:1;min-width:140px"><small>≈ US dollars (POL @ $${d.polUsd<0.1?d.polUsd.toFixed(4):d.polUsd.toFixed(2)})</small><strong style="font-size:22px;color:var(--ok)">$${(st.downPol*d.polUsd).toLocaleString(undefined,{maximumFractionDigits:0})}</strong></div>`:'')+
|
||||
`</div>`;
|
||||
}
|
||||
function renderTree(){
|
||||
|
||||
Reference in New Issue
Block a user