Inflect

Merges the singular or plural form of a word, chosen by a count. Use it so a message never reads "You have 1 tickets".

Syntax

{{inflect count singular plural include}}

Parameters

Name Type Required Description
Count Number Required The number that decides which form is used.
Singular Text Required The word to use when the count is one.
Plural Text Required The word to use otherwise.
Include Boolean Optional Whether the count itself appears before the word. Defaults to false.
Note: Tarvent does not guess the plural, you supply both forms. That is what lets it handle words such as "person" and "people" correctly.

Examples

The examples below are based on the following sample content:

You have {{inflect Contact.tickets "ticket" "tickets" true}}

A. The contact's tickets field has the value 3

You have 3 tickets

B. The contact's tickets field has the value 1

You have 1 ticket

C. The value is 3 and include is left out or set to false

You have tickets

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us