title: JavaScript if Statement .length not working. Why?
body: <p>I have this if statement i have came up with here:</p>
  
  <pre><code>var TotalMoney=0;
  var Orbs=0;
  if (TotalMoney.length==2) {
  Orbs+=1;
  }
  </code></pre>
  
  <p>What this code is supposed to do is if the the "TotalMoney" value digit length equals 2,
  example (the number 10 has 2 digits)
  then it will add 1 "Orb" to the "Orbs" value. Currently, it does nothing. There is HTML and CSS linked to this code but i figured the problem is in this code as it works fine for everything else. Please fix it as i have been trying for hours. Thanks!</p>
  
  <p>For my second question that i just found out with this code here:</p>
  
  <pre><code>var totalMoney=0;
  var orbs=0;
  if (totalMoney.toString().length==2) {
  orbs+=1;
  }
  </code></pre>
  
  <p>This works on getting the number value digits as 2 digits long. The problem now is that once it reaches 10, every time that number goes up (10-99) all the way up, it will add 1 orb each time. I only want it to add 1 orb only when it gets to the 2 digit number (10) and stops adding 1 orb after it reaches it. How can i achieve this? Thanks!</p>