Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sylvaindethier/b196424cbb97f32c9181 to your computer and use it in GitHub Desktop.
Save sylvaindethier/b196424cbb97f32c9181 to your computer and use it in GitHub Desktop.
Handlebars helper for pluralization
/**
* Pluralization outputs singular or plural given a value
*/
Handlebars.registerHelper('pluralize', function (value, singular, plural) {
return value > 1 ? plural : singular;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment