title: Why does .NET use banker's rounding as default?
body: <p>According to the documentation, the <a href="http://msdn.microsoft.com/en-us/library/zy06z30k.aspx" rel="noreferrer"><code>decimal.Round</code></a> method uses a round-to-even algorithm which is not common for most applications. So I always end up writing a custom function to do the more natural round-half-up algorithm:</p>
  
  <pre><code>public static decimal RoundHalfUp(this decimal d, int decimals)
  {
      if (decimals &lt; 0)
      {
          throw new ArgumentException("The decimals must be non-negative", 
              "decimals");
      }
  
      decimal multiplier = (decimal)Math.Pow(10, decimals);
      decimal number = d * multiplier;
  
      if (decimal.Truncate(number) &lt; number)
      {
          number += 0.5m;
      }
      return decimal.Round(number) / multiplier;
  }
  </code></pre>
  
  <p>Does anybody know the reason behind this framework design decision?</p>
  
  <p>Is there any built-in implementation of the round-half-up algorithm into the framework? Or maybe some unmanaged Windows API?</p>
  
  <p>It could be misleading for beginners that simply write <code>decimal.Round(2.5m, 0)</code> expecting 3 as a result but getting 2 instead.</p>