Skip to content

Instantly share code, notes, and snippets.

@thehungrycoder
Last active December 13, 2015 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thehungrycoder/4943089 to your computer and use it in GitHub Desktop.
Save thehungrycoder/4943089 to your computer and use it in GitHub Desktop.
Handlebars.registerHelper('addition', function(context, options){
return context + parseFloat(options.hash.to);
});
/**
* usages (handlebars)
* {{addition 10 to=10}}
* {{addition this to=20}}
* {{addition this to="-5"}}
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment