MCPcopy
hub / github.com/CodebuffAI/codebuff / convertCreditsToUsdCents

Function convertCreditsToUsdCents

common/src/util/currency.ts:7–12  ·  view source on GitHub ↗
(
  credits: number,
  centsPerCredit: number,
)

Source from the content-addressed store, hash-verified

5 * @returns The amount in USD cents
6 */
7export function convertCreditsToUsdCents(
8 credits: number,
9 centsPerCredit: number,
10): number {
11 return Math.ceil(credits * centsPerCredit)
12}
13
14/**
15 * Converts a Stripe grant amount in cents to credits.

Callers 2

processAutoTopupPaymentFunction · 0.90
POSTFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected