I have an object that is managed by the WCF service, so the entity is generated through a service link, so I cannot annotate it to indicate the data format. It is decimal and must be formatted with 6 decimal places. How can I do this in MVC3, on the display and in the editor?
On display I could use
@Html.Display(format("{0:f4}", model.MyField))
He is not very elegant, but he is efficient. But how can I do this to format an editor with four decimal places?
EDIT:
I found this answer to a similar question, but it gives me an error in the line
return html.TextBox(name, value, htmlAttributes);
Any idea how to solve it?
thanks
source share