I have picked up an MVC solution and I am trying to format a double variable to 2 decimal places on a form table. In the modelview it is set using
[DisplayFormat(DataFormatString = "{0:F2}", ApplyFormatInEditMode = true)]
before the public double declaration But this is not passed through to the table. The table is created using javascript.
I have tried to modify the variable in the javascript but that fails. here is an extract of the code used
<div class="row">
<div class="col-md-3">Journey distance in miles</div>
<div class="col-md-9">@Model.Miles</div>
</div>
The web page just displays the value without any formatting I am new to this, so apologize in advance if it is obvious