How to floor integer value in Javascript
<p>It sounds weird but I need this for now.Actually I have an array like that :</p>

<pre><code>var arr = new Array(123, 432, 98, 227, 764);
var max = Math.max.apply(Math, arr); //calculate max = 764
var min = Math.min.apply(Math, arr); //calculate min = 123
</code></pre>

<p>Now I have to make several range based on the min and max:</p>

<pre><code> 100 - 200 // as the min is 123 (range 100 ~ 200) 
 201 - 300
 301 - 400
 401 - 500
 501 - 600
 601 - 700
 701 - 800 // as the min is 764 (range 700 ~ 800)
</code></pre>

<p>Making the range is just a loop issue.But calculating the range of min and max I implemented as :</p>

<pre><code>function integerRound (digit) {
    var i = 0, msb; 
    while( digit &gt; 0 ) {
      msb = digit % 10;
      digit = Math.floor( digit / 10 );
      i++;
    }
    while ( i &gt; 1 ) {
      msb = msb + '0';
      i--;
    };
    return msb;
}

var lowerMin = integerRound(min); // 100
var lowerMax = integerRound(max); // 700
</code></pre>

<p>My question is - Is there any good way to do that in javascript or jQuery?</p>
