title: Javascript not rounding properly
body: <p>I made a simple number guessing game in javascript which goes from 1 to 100.<br>
  My problem is that everything works, except when I type a decimal number from 100 to 101. I want my code to give me the &quot;Please enter a number from 1 to 100&quot; message then, but it doesn't.<br>
  How do I get Javascript to round this properly?<br></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let randomNumber = Math.floor(Math.random() * 100); // Random number
  
  function guess() {
    let inp = document.getElementById("number").value; // Reading input
    let inpRounded = Math.floor(inp);
  
    // Random number is higher
    if (inpRounded &lt; randomNumber &amp;&amp; inpRounded &gt;= 1 &amp;&amp; inpRounded &lt;= 100) {
      document.getElementById("result").innerHTML = "Higher";
    }
    // Random number is lower
    else if (inpRounded &gt; randomNumber &amp;&amp; inpRounded &gt;= 1 &amp;&amp; inpRounded &lt;= 100) {
      document.getElementById("result").innerHTML = "Lower";
      // Input matches random number 
    } else if (inpRounded == randomNumber &amp;&amp; inpRounded &gt;= 1 &amp;&amp; inpRounded &lt;= 100) {
      document.getElementById("result").innerHTML = "You won!";
    }
    // Input is weird
    else if (inpRounded == null) {
      document.getElementById("result").innerHTML = "Please enter a valid number";
    }
    // Input is lower than 1 or higher than 100
    else if (inpRounded &lt; 1 || inpRounded &gt; 100) {
      document.getElementById("result").innerHTML = "Please enter a number from 1 to 100";
    }
    // Other issue
    else {
      document.getElementById("result").innerHTML = "Error"
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;h2&gt;Enter a number from 1 to 100&lt;/h2&gt;
  &lt;input type="number" placeholder="Type your guess here" id="number"&gt;
  &lt;input type="button" value="Go!" onclick="guess()"&gt;
  &lt;p id="result"&gt;&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>