title: formatting a decimal as percentage to display in view?
body: <p>In MVC Razor view, a decimal field is required to be displayed as percentage <strong>BUT</strong> without percentage sign. For example  <code>2</code> or <code>2.5</code></p>
  
  <p>I understand it can be from model and it will be something like:</p>
  
  <pre><code>    [AutoMapIgnore]
      [DisplayFormat(DataFormatString = "{0:F1}")]
      public virtual decimal OffPeakMarginPercent { get { return OffPeakMargin * 100; } }
  </code></pre>
  
  <p>But is not doing any effecting at all, currently it is being displayed as:</p>
  
  <p>Currently it is being displayed as <code>3.00000</code> or <code>2.50000</code>. </p>
  
  <p>Can you please guide.</p>
  
  <p>I highly appriciate your guidance and help.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>If I format in view as below, it displays as <code>3.0</code>  or <code>2.5</code></p>
  
  <pre><code>@row.OffPeakMarginPercent.ToString("0.0")
  </code></pre>