Skip to content

pluralizeWithCount

pluralizeWithCount(word, count) → string · String

Return a formatted string with count and correctly pluralized word.

  • word (required): singular noun

  • count (required): the number

bash
echo '{"n": 5}' | utlx -e 'pluralizeWithCount("item", $input.n)'
# "5 items"
utlx
{
  summary: pluralizeWithCount("error", count($input.errors))
}

Released under AGPL-3.0.