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

Function formatCreditAmount

src/services/api/referral.ts:154–159  ·  view source on GitHub ↗
(reward: ReferrerRewardInfo)

Source from the content-addressed store, hash-verified

152}
153
154export function formatCreditAmount(reward: ReferrerRewardInfo): string {
155 const symbol = CURRENCY_SYMBOLS[reward.currency] ?? `${reward.currency} `
156 const amount = reward.amount_minor_units / 100
157 const formatted = amount % 1 === 0 ? amount.toString() : amount.toFixed(2)
158 return `${symbol}${formatted}`
159}
160
161/**
162 * Get cached referrer reward info from eligibility cache

Callers 4

PassesFunction · 0.85
createGuestPassesFeedFunction · 0.85
GuestPassesUpsellFunction · 0.85
tipRegistry.tsFile · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected