Modifier: plural


Get the plural form of an English word. Accepts a numerical parameter, either as a literal value or a variable, to control plurality. It’s important to note that you should use the singular form of the word to ensure the best results.

shopping_list:
  - item: pickle
    quantity: 1
  - item: apple
    quantity: 12
  - item: donut
    quantity: 500
Please pick up the following items:
{{ shopping_list }}
  - {{ quantity }} {{ item | plural:quantity }}.
{{ /shopping_list }}
Please pick up the following items:
- 1 pickle
- 3 apples
- 500 donuts

Additional Reading

Learn how to use and chain modifiers in the Antlers template guide.

Last modified on March 31, 2016