Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not actually a issue but request for adding another imp. maths helper function i.e Factorial of a Number #101

Open
GunarajKhatri opened this issue Apr 20, 2022 · 3 comments

Comments

@GunarajKhatri
Copy link

code:

const factorial=(num)=>{
if(num===0 || num===1){
return 1;
}
return num*factorial(num-1);
}
console.log(factorial(18)) //6402373705728000
@GunarajKhatri
Copy link
Author

.

@mesaugat
Copy link
Member

@GunarajKhatri Sorry for the very late reply.

You can add this helper yourself here --> https://github.com/leapfrogtechnology/just-handlebars-helpers/blob/main/src/helpers/math.js and send a Pull Request.

Also, don't forget to add some tests here --> https://github.com/leapfrogtechnology/just-handlebars-helpers/blob/main/tests/helpers/math.spec.js

We can happily merge the PR if you send it over. Thank you. Unfortunately there are no active contributors in this repository that can help you right away.

@bitcoinBandit1234
Copy link

bitcoinBandit1234 commented Mar 9, 2023

@mesaugat How do we tackle decimal and negative numbers though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants