Within a view I have the following code:
@foreach (var ce in Model.MyObjectCollection)
{
<p>
Target: @ce.Target.ToString("#.##")%
<br/>
Level: @ce.Level.ToString("#.##")%
</p>
}
If either the value of Target
or Level
is 0.00, then MVC simply renders that out as an empty string. Debugging shows the value of each to be 0.00.
I need zero values to render as 0.00%.
Can anyone advise if I'm doing something wrong?