Hex Core JS
    Preparing search index...

    Function toGrammaticalNumber

    • Converts the given word to the correct form with reference to grammatical number (singular or plural) based on the given quantity. Optionally, the quantity can be included in the resulting string before the word.

      Parameters

      • word: string

        The word to convert.

      • quantity: number = 2

        The quantity to use for conversion.

      • includeQuantity: boolean = false

        Indicates whether to include the given quantity in the result.

      • options: { format?: (quantity: number) => string } = {}

        Additional options for the conversion.

        • Optionalformat?: (quantity: number) => string

          A function to format the quantity into a string. Only relevant if includeQuantity is true.

      Returns string