title: Rounding of negative numbers in Javascript
body: <p>We have come across a problem with <strong>Math.round()</strong> in JavaScript. The problem is that this function doesn't round correctly for negative numbers. For example :</p>
  
  <p>1.5 ~= 2</p>
  
  <p>0.5 ~= 1</p>
  
  <p>-0.5 ~= 0 // Wrong</p>
  
  <p>-1.5 ~= -1 // Wrong</p>
  
  <p>And this is not correct according to arithmetic rounding. The correct numbers for -0.5 should be -1 and -1.5 should be -2. </p>
  
  <p><strong>Is there any standard way, to correctly round negative numbers in Javascript ?</strong> </p>