MCPcopy Create free account
hub / github.com/WebDevSimplified/course-platform / formatPlural

Function formatPlural

src/lib/formatters.ts:1–9  ·  view source on GitHub ↗
(
  count: number,
  { singular, plural }: { singular: string; plural: string },
  { includeCount = true } = {}
)

Source from the content-addressed store, hash-verified

1export function formatPlural(
2 count: number,
3 { singular, plural }: { singular: string; plural: string },
4 { includeCount = true } = {}
5) {
6 const word = count === 1 ? singular : plural
7
8 return includeCount ? `${count} ${word}` : word
9}
10
11export function formatPrice(amount: number, { showZeroAsNumber = false } = {}) {
12 const formatter = new Intl.NumberFormat(undefined, {

Callers 5

ProductTableFunction · 0.90
CourseTableFunction · 0.90
PurchaseTableFunction · 0.90
ProductPageFunction · 0.90
CourseGridFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected