我正在使用Razor View,我有列表。我发送这个列表控制器来查看和填写“div”内部,但是当我填写这个div时,我想在列表中格式化一些数字?
你有什么想法吗?
这是我的观看代码
@{
var statuslist = ViewBag.List;
for (int i = 0; i < statuslist.Count; i++)
{
<div id="count" style="display:none;">@statuslist.Count</div>
<div id="@statuslist[i].StationCode" class="@statuslist[i].Alert" style="border:1px solid #808080;border-radius:5px;width:250px;height:100px;float:left;margin:5px;" onclick="opendetail(@statuslist[i].StationCode)">
<span style="font-size:small;font-family:Verdana;color:#808080">@statuslist[i].StationCode - @statuslist[i].StationName</span>
<div class="dvstatus_@i">@statuslist[i].Status - Last Check : @statuslist[i].LastCheck</div><input id="alertid_@i" type="text" style="display:none;" value="@statuslist[i].Alert"/>
<div style="margin-left:10px;margin-top:5px;">
<div>FUEL - @statuslist[i].TotalWet</div> // here i want to format
<div>DRY - @statuslist[i].TotalDry</div> // here i want to format
@if (statuslist[i].Alert == "ONLINE")
{
<img src="~/Content/img/ok.png" style="position: relative;bottom: 35px;left: 160px;width:40px;height:40px;"/>
}
else if (statuslist[i].Alert == "WARNING")
{
<img src="~/Content/img/alert.png" style="position: relative;bottom: 35px;left: 160px;width:40px;height:40px;"/>
}
else
{
<img src="~/Content/img/error.png" style="position: relative;bottom: 35px;left: 160px;width:40px;height:40px;"/>
}
</div>
</div>
}
}