title: C# correct and efficient conversion of double to decimal
body: <p>What is the most efficient (and strictly correct) way to convert from a <code>double</code> to a <code>decimal</code> rounded to <code>n</code> places of precision?</p>
  
  <p>I am using <code>decimal.Round((decimal)d, n, MidpointRounding.AwayFromZero)</code> but it occurs to me that I am rounding twice here- once duing the cast <code>(decimal)d</code> and once via <code>Round()</code>.</p>
  
  <p>Is there a way to <em>directly</em> round a <code>double</code> to a <code>decimal</code> to <code>n</code> places?  I suppose I can round trip it via strings but that seems ugly and expensive.</p>
  
  <hr>
  
  <p>5/12/2017: i added an issue to corefx github here <a href="https://github.com/dotnet/corefx/issues/19706" rel="nofollow noreferrer">https://github.com/dotnet/corefx/issues/19706</a></p>