mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-07-23 16:04:53 +00:00
feat(overview): full comma-grouped numbers for a precise, spacious look
Render token counts as full thousands-grouped integers (e.g. 3,926,923,819) instead of abbreviated M/B, so the roomy tables read like a precise statement. Update the overview test to match.
This commit is contained in:
parent
40042365ea
commit
8d727d9cc4
2 changed files with 6 additions and 6 deletions
|
|
@ -4,18 +4,17 @@ import { homedir } from 'os'
|
|||
|
||||
import { CATEGORY_LABELS, type ProjectSummary, type TaskCategory } from './types.js'
|
||||
import { formatCost as baseCost } from './currency.js'
|
||||
import { formatTokens as baseTokens } from './format.js'
|
||||
import { getShortModelName } from './models.js'
|
||||
import { dateKey } from './day-aggregator.js'
|
||||
|
||||
// Display-only helpers. The shared formatters omit thousands separators and stop
|
||||
// at M; aggregation uses raw numbers, these only affect rendering.
|
||||
// Display-only helpers. The shared formatters omit thousands separators and
|
||||
// abbreviate; here we show full, comma-grouped numbers so the tables read like
|
||||
// a precise statement. Aggregation uses raw numbers; these only affect render.
|
||||
function formatCost(usd: number): string {
|
||||
return baseCost(usd).replace(/(\d)(?=(\d{3})+(\.|$))/g, '$1,')
|
||||
}
|
||||
function formatTokens(n: number): string {
|
||||
if (n >= 1_000_000_000) return `${(n / 1_000_000_000).toFixed(2)}B`
|
||||
return baseTokens(n)
|
||||
return Math.round(n).toLocaleString()
|
||||
}
|
||||
function projectName(p: ProjectSummary): string {
|
||||
const path = p.projectPath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue