MCPcopy Create free account
hub / github.com/Noumena-Network/code / formatPrice

Function formatPrice

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

Source from the content-addressed store, hash-verified

250}
251
252function formatPrice(price: number): string {
253 // Format price: integers without decimals, others with 2 decimal places
254 // e.g., 3 -> "$3", 0.8 -> "$0.80", 22.5 -> "$22.50"
255 if (Number.isInteger(price)) {
256 return `$${price}`
257 }
258 return `$${price.toFixed(2)}`
259}
260
261/**
262 * Format model costs as a pricing string for display

Callers 1

formatModelPricingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected