Add comma formatting to input and output token displays
The token counts now display with commas in both the terminal UI and web UI.
Co-Authored-By: sketch <hello@sketch.dev>
diff --git a/webui/src/web-components/sketch-container-status.test.ts b/webui/src/web-components/sketch-container-status.test.ts
index b7dfd01..35c52b8 100644
--- a/webui/src/web-components/sketch-container-status.test.ts
+++ b/webui/src/web-components/sketch-container-status.test.ts
@@ -47,10 +47,10 @@
mockCompleteState.total_usage.cache_read_input_tokens +
mockCompleteState.total_usage.cache_creation_input_tokens;
await expect(component.locator("#inputTokens")).toContainText(
- expectedTotalInputTokens + "",
+ expectedTotalInputTokens.toLocaleString(),
);
await expect(component.locator("#outputTokens")).toContainText(
- mockCompleteState.total_usage.output_tokens + "",
+ mockCompleteState.total_usage.output_tokens.toLocaleString(),
);
await expect(component.locator("#totalCost")).toContainText(
"$" + mockCompleteState.total_usage.total_cost_usd.toFixed(2),
@@ -103,7 +103,7 @@
partialState.total_usage.cache_read_input_tokens +
partialState.total_usage.cache_creation_input_tokens;
await expect(component.locator("#inputTokens")).toContainText(
- expectedTotalInputTokens + "",
+ expectedTotalInputTokens.toLocaleString(),
);
// Check that elements without data are empty