diff --git a/ui/src/ui/chat/token-format.test.ts b/ui/src/ui/chat/token-format.test.ts index 52b5e63e7c4..5215099d194 100644 --- a/ui/src/ui/chat/token-format.test.ts +++ b/ui/src/ui/chat/token-format.test.ts @@ -20,7 +20,7 @@ describe("formatCompactTokenCount", () => { }); it("rolls values that round up to 1000.0k over into the M branch instead of showing 1000k", () => { - // Regression test: 999,500-999,999 round to "1000.0" at one-decimal + // Regression test: 999,950-999,999 round to "1000.0" at one-decimal // thousands precision. Before the fix, the >= 1_000_000 branch check // ran on the raw value (which is still < 1_000_000), so these fell // through to the k branch and displayed the nonsensical "1000k". diff --git a/ui/src/ui/chat/token-format.ts b/ui/src/ui/chat/token-format.ts index 1d3ea55adb6..8be968d5f3e 100644 --- a/ui/src/ui/chat/token-format.ts +++ b/ui/src/ui/chat/token-format.ts @@ -4,7 +4,7 @@ export function formatCompactTokenCount(tokens: number): string { return `${(tokens / 1_000_000).toFixed(1).replace(/\.0$/, "")}M`; } if (tokens >= 1_000) { - // Values from 999,500-999,999 round to "1000.0" at one-decimal + // Values from 999,950-999,999 round to "1000.0" at one-decimal // thousands precision, which would display the nonsensical "1000k" // instead of rolling over to the M branch above. Re-check the // rounded result before formatting.