title: JavaScript round number to first two digits?
body: <p>I'm trying to round a number up to the first two digits.</p>
  
  <pre><code>14300 -&gt; 15000
  1430  -&gt; 1500
  143   -&gt; 150
  14    -&gt; 14
  </code></pre>
  
  <p>I have figured out this much:</p>
  
  <pre><code>var n = 14300;
  n = parseFloat(Math.ceil(n).toPrecision(2));
  console.log(n);
  </code></pre>
  
  <p>It returns 14000, but I want to round it up. Math.ceil only works to the next integer.
  <a href="http://jsfiddle.net/cruTY/" rel="nofollow">http://jsfiddle.net/cruTY/</a></p>
  
  <p>Note: I know I can divide <code>n</code> to make it a decimal, but I want this function to work for all numbers without having to manually insert <code>/1000</code> or <code>/1000000</code>.</p>