Skip to main content

Inflection Operators

When we need to work with inflection, these operators will help with your markdown.

List of Operators

{{ inflect }}

Returns either the singular or plural inflection of a word based on the given count.

Params

  • count
  • singular : The singular form
  • plural : The plural form
  • includeCount
  • returns

Example

{{inflect 0 "string" "strings"}}
<!-- "strings" -->
{{inflect 1 "string" "strings"}}
<!-- "string" -->
{{inflect 1 "string" "strings" true}}
<!-- "1 string" -->
{{inflect 2 "string" "strings"}}
<!-- "strings" -->
{{inflect 2 "string" "strings" true}}
<!-- "2 strings" -->

{{ ordinalize }}

Returns an ordinalized number as a string.

Params

  • val : The value to ordinalize.
  • returns : The ordinalized number

Example

{{ordinalize 1}}
<!-- '1st' -->
{{ordinalize 21}}
<!-- '21st' -->
{{ordinalize 29}}
<!-- '29th' -->
{{ordinalize 22}}
<!-- '22nd' -->