diff --git a/override.js b/override.js index e4a316c..43035ab 100644 --- a/override.js +++ b/override.js @@ -57,7 +57,7 @@ async function report(from, to) { const c = cfg(); const rows = [], per = {}; for (const p of purchases()) { if (p.ts < from || p.ts >= to || (c.goLive && p.ts < c.goLive)) continue; - const wei = BigInt(p.paidWei || '0') * BigInt(PCT) / 100n, cents = Math.round((p.priceCents || 0) * PCT) / 100; + const wei = BigInt(p.paidWei || '0') * BigInt(PCT) / 100n, cents = Math.round((p.priceCents || 0) * PCT) / 10000; // dollars: price cents x 3% / 100 const r = await recipientFor(p.buyerId).catch(e => ({ recipientId: 0, reason: 'read failed: ' + e.message })); rows.push({ tx: p.tx, ts: p.ts, buyerId: p.buyerId, priceCents: p.priceCents, overrideWei: wei.toString(), overrideUsd: cents, recipientId: r.recipientId, hops: r.hops || 0, skipped: r.skipped || [], reason: r.reason || '' }); if (r.recipientId) { const o = per[r.recipientId] = per[r.recipientId] || { recipientId: r.recipientId, purchases: 0, wei: 0n, usd: 0 }; o.purchases++; o.wei += wei; o.usd += cents; }