title: How to format decimal in MVC3 with more than 2 decimals
body: <p>I have an entity that is managed by a WCF service, so the entity is generated through service reference so I cannot annotate it to specify data format.
  It is decimal and must be formatted with 6 decimals.
  How can I accomplish this in MVC3, in display and editor?</p>
  
  <p>In display I could use </p>
  
  <pre><code>@Html.Display(format("{0:f4}", model.MyField))
  </code></pre>
  
  <p>It's not very elegant, but it's workable.
  But how can I do this for formatting the editor with 4 decimals?</p>
  
  <p>EDIT:</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/4617397/html-helpers-for-decimal-type-and-formatting">this</a> answer to a similar question, but it gives me error in line</p>
  
  <pre><code>return html.TextBox(name, value, htmlAttributes);
  </code></pre>
  
  <p>Any idea how to solve it?</p>
  
  <p>Thanks</p>