// Formatting helpers ported from app.js's `fmtTokens`/`fmtAge` (same // output shapes — this page's operators are used to reading them). export function fmtTokens(n: number): string { if (n >= 1_000_000) return (n / 1_000_000).toFixed(1) + 'M'; if (n >= 1_000) return Math.round(n / 1000) + 'k'; return String(n); } export function fmtAge(ms: number): string { const s = Math.floor(ms / 1000); if (s < 60) return s + 's'; const m = Math.floor(s / 60); if (m < 60) return m + 'm ' + (s % 60) + 's'; const h = Math.floor(m / 60); return h + 'h ' + (m % 60) + 'm'; }