Reference · Browser table and SVG
tenkaCountfunction
A count said in the singular when it is one and the plural otherwise: tenkaCount(strings.countCardsOne, strings.countCards, 1) is "1 card". The line gets the number as {n}.
Import it
import { tenkaCount } from "@johnmorrisdotca/tenka/ui";
Also exported from: @johnmorrisdotca/tenka
Definition
function tenkaCount(one: string, other: string, n: number): string
Parameters
| Name | Type | Description |
|---|---|---|
one | string | The line for exactly one. |
other | string | The line for any other number, nought included. |
n | number | The number. |
Returns
string
The count said in the singular when it is one and the plural otherwise.
Examples
import { TENKA_STRINGS, tenkaCount } from "@johnmorrisdotca/tenka/ui";
console.log(tenkaCount(TENKA_STRINGS.en.countCardsOne, TENKA_STRINGS.en.countCards, 1));1 cardWhat it prints (run when this page was built)