agent ctx-badge: format >=1M as X,YM
This commit is contained in:
parent
118fbe6a71
commit
93fe1a60dc
1 changed files with 5 additions and 1 deletions
|
|
@ -535,7 +535,11 @@
|
||||||
if (!el_) return;
|
if (!el_) return;
|
||||||
if (!u) { el_.hidden = true; return; }
|
if (!u) { el_.hidden = true; return; }
|
||||||
const ctx = u.input_tokens + u.cache_read_input_tokens + u.cache_creation_input_tokens;
|
const ctx = u.input_tokens + u.cache_read_input_tokens + u.cache_creation_input_tokens;
|
||||||
const fmt = (n) => n >= 1000 ? Math.round(n / 1000) + 'k' : String(n);
|
const fmt = (n) => {
|
||||||
|
if (n >= 1_000_000) return (n / 1_000_000).toFixed(1).replace('.', ',') + 'M';
|
||||||
|
if (n >= 1_000) return Math.round(n / 1000) + 'k';
|
||||||
|
return String(n);
|
||||||
|
};
|
||||||
el_.hidden = false;
|
el_.hidden = false;
|
||||||
el_.title = [
|
el_.title = [
|
||||||
'context window in use',
|
'context window in use',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue