title: How to display number to 2 decimal places in mvc3,C#?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6951335/using-string-format-to-show-decimal-upto-2-places-or-simple-integer">Using String Format to show decimal upto 2 places or simple integer</a><br>
    <a href="https://stackoverflow.com/questions/13284682/how-to-set-decimal-point-in-2-decimal-places">How to set decimal point in 2 decimal places?</a>  </p>
  </blockquote>
  
  
  
  <p>I have Price field in my view. it have the following values <code>2.5 and 44.</code>
  I want to display this value to <code>2.50 and 44.00</code> i use the following code</p>
  
  <pre><code>@{decimal prolistprice = decimal.Parse(item.OtherFields["Price"].ToString());}
    $@Math.Round(prolistprice, 2, MidpointRounding.AwayFromZero)
  </code></pre>
  
  <p>in which <code>item.OtherFields["price"] is a object</code> i convert it to string and then decimal</p>
  
  <p>but Math.round is not working it shows 2.5 and 44 only..
  Can anyone help this</p>