MCPcopy Create free account
hub / github.com/IIIIQIIII/claude-code / formatTotalCost

Function formatTotalCost

src/cost-tracker.ts:228–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226}
227
228export function formatTotalCost(): string {
229 const costDisplay =
230 formatCost(getTotalCostUSD()) +
231 (hasUnknownModelCost()
232 ? ' (costs may be inaccurate due to usage of unknown models)'
233 : '')
234
235 const modelUsageDisplay = formatModelUsage()
236
237 return chalk.dim(
238 `Total cost: ${costDisplay}\n` +
239 `Total duration (API): ${formatDuration(getTotalAPIDuration())}
240Total duration (wall): ${formatDuration(getTotalDuration())}
241Total code changes: ${getTotalLinesAdded()} ${getTotalLinesAdded() === 1 ? 'line' : 'lines'} added, ${getTotalLinesRemoved()} ${getTotalLinesRemoved() === 1 ? 'line' : 'lines'} removed
242${modelUsageDisplay}`,
243 )
244}
245
246function round(number: number, precision: number): number {
247 return Math.round(number * precision) / precision

Callers 2

fFunction · 0.85
callFunction · 0.85

Calls 9

formatCostFunction · 0.85
getTotalCostUSDFunction · 0.85
hasUnknownModelCostFunction · 0.85
formatModelUsageFunction · 0.85
getTotalAPIDurationFunction · 0.85
getTotalDurationFunction · 0.85
getTotalLinesAddedFunction · 0.85
getTotalLinesRemovedFunction · 0.85
formatDurationFunction · 0.50

Tested by

no test coverage detected