Skip to main content

pluralize

Can be used to either pluralize a singular noun, or to conditionally pluralize a noun based on a count.

Parameters

input (String, Integer)

The input to pluralize. If it's a string, that string will be unconditionally pluralized. If it's a number, pluralize will read the singular and plural parameters and decide between them depending on whether input is 1.

plural (String)

Optional. If input is a number, this will be the result if input is not 1.

singular (String)

Optional. If input is a number, this will be the result if input is 1.

Returns (String)

The pluralized string or phrase

Examples

Pluralizing a noun unconditionally
{{ "goose" | pluralize }} => "geese"
Pluralizing a count
You are signed up for {{ user_con_profile.signups.length | pluralize "game" "games" }}
=> "You are signed up for 3 games"