title: C#: Round decimal for display only when the decimal point is 0 (eg: 3.00 --> 3)
body: <p>I am storing Amount in Decimal(18,2). But most of my data is actually integer with only few decimal. So when I display the amount for each item in the table, the number display is all 3.00, 4.00, 5.00 and so on.</p>
  
  <p>I feel it is kind of weird to display all the 0 as the decimal point. I wish to format the number when display if the decimal point is 0.</p>
  
  <p>Currently I am displaying the amount like this:</p>
  
  <pre><code>  &lt;td id="amnt@(item.FoodID)" class="amountfield"&gt;
        @Html.DisplayFor(modelItem =&gt; item.FoodAmount)
    &lt;/td&gt;
  </code></pre>
  
  <p>Any idea?? Appreciate every help... thanks...</p>