as there I have the same problem, while using the method it converts small double to scientific notation (0.000028 -> 2.8e-005).
I did a little research on that and didn't find anything that would let me use @Html.TextBoxFor() still and show data as I want. Basically, the solutions I see are either change the element to Html.EditorFor() or Html.DisplayFor() and create some template on them.
As the project may have hundreds of input boxes on one form the solution I've found will be an overkill. Is there any way to keep the method and render data as I want?
I suppose the following might be solution:
@Html.TextBoxFor(m => m.Data, "{0:#,0.######}")
Where Data
is double
.
@Html.TextBoxFor(m => m.Data, "{0:#,0.######}", new { type = "number", @min=-99999, @max=99999, @step="any" })