MCPcopy
hub / github.com/codeaashu/claude-code / formatPrice

Function formatPrice

src/utils/modelCost.ts:204–211  ·  view source on GitHub ↗
(price: number)

Source from the content-addressed store, hash-verified

202}
203
204function formatPrice(price: number): string {
205 // Format price: integers without decimals, others with 2 decimal places
206 // e.g., 3 -> "$3", 0.8 -> "$0.80", 22.5 -> "$22.50"
207 if (Number.isInteger(price)) {
208 return `$${price}`
209 }
210 return `$${price.toFixed(2)}`
211}
212
213/**
214 * Format model costs as a pricing string for display

Callers 1

formatModelPricingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected