Im adding two variables, “giveMoney” and “money”, but they result in a number with like 15 decimals.
The code is referenced below.
giveMoney = users; // Users is equal to one in this scenario
giveMoney /= 10;
money += giveMoney;
Im not sure on how to fix this…
For context, this is for a Incremental Clicker game im working on, and the output is going to a <p>
element with the id “money”.
Any ideas?
giveMoney = users; // Users is equal to one in this scenario
giveMoney /= 10;
money += giveMoney;
Im not sure on how to fix this…
I’ve tried doing a .toFixed(1); on it, but i dont want it to constantly have a decimal.
For context, this is for a Incremental Clicker game im working on, and the output is going to a <p>
element with the id “money”.
Any ideas?
billy cooper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1