title: Round number to nearest thousand, up or down depending on the number
body: <p>I want to round up a number to the nearest thousand, at the moment I'm using this:</p>
  
  <pre><code>Math.ceil(value/1000)*1000;
  </code></pre>
  
  <p>But this goes always up, if I type 1001 it will go to 2000, I want to go up or down depeding on the number, for example 1001 goes to 1000 or 1400 goes to 1000 but 1500 goes to 2000</p>
  
  <p>EDIT:</p>
  
  <pre><code>if(value&lt;1000){
    value = 1000;
  }else{
    value = Math.round(value/1000)*1000;
  }
  </code></pre>