For example, if I produce the factorial of 100 and store it in this way using JavaScript:
function factorial (num) {
if (num == 0) {
return 1;
}
else {
return num * factorial(num - 1);
}
}
var result = factorial(100);
console.log(result)
will then produce 9.33262154439441e+157
.
Is there a way to have it display in full?
As a string would be fine, but result.toString()
literally produces "9.33262154439441e+157"
.
If there's some way to imitate charAt()
for numbers, iterating over each digit and concatenating them as a string would become an option.
All in all, is there any way to achieve this?