title: How to use Math.round to round numbers to the nearest EVEN number?
body: <p>Using JavaScript only please.</p>
  
  <p>This is the first time I am attempting to write JavaScript on my own. I've successfully manipulated codes that friends have written for me in the past, but I have never written my own from scratch, nor took the time to try and understand the language itself until recently.</p>
  
  <p>I'm trying to make a basic bra size calculator that takes numbers (measurements) from user input, routes them into a function and returns (calculates) a bra size to the user.</p>
  
  <p>Since I'm so new to this language, I'm only trying to write one part right now - "band size"</p>
  
  <p>I have an input field for users to type in their "under bust measurement" which I currently have set to round. This works as it intended. See here</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
  
  &lt;script type="text/javascript"&gt;
  
   function calculate() 
    {
     var underbust = document.getElementById("underBust").value;
  
      if (underbust.length === 0) 
       {
        alert("Please enter your underbust measurement in inches");
        return;
       }
  
      document.getElementById("bandsize").innerHTML = Math.round(underbust);
     }
  
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;input type="number" id="underBust" /&gt; inches&lt;br&gt;
  &lt;input type="submit" value="Submit" onclick="calculate()" /&gt;&lt;br&gt;
  &lt;b&gt;underbust:&lt;/b&gt; &lt;div id="bandsize"&gt;bandsize will appear here&lt;/div&gt;&lt;br&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>However, I don't need the input 'underBust' to round to the nearest whole number. I need it to round to the nearest EVEN whole number, since bra band sizes only come in even whole numbers.</p>
  
  <p>For example, if the user inputs the number "31.25" the code would currently round it to "31" but I need it to round it to "32"</p>
  
  <p>If the user inputs the number "30.25" the code would round it correctly to "30" because the nearest whole number and nearest whole even number are the same in this case. However, if the user inputs "30.5" the code would round it up to "31" but I still need it to round down to "30"</p>
  
  <p>Basically, I need the number to be rounded UP if the user input is equal to or greater than an odd number (29.00 becomes 30, 31.25 becomes 32, etc.). If the user input is greater than or equal to an even number and less than the next odd number (28, 28.25, 28.75, etc.) I need it to round down (in the previous example, to 28 for all cases). The odd number is the middle divide for rounding, instead of the ".5" of any number.</p>
  
  <p>Is this possible?</p>