1
我需要的是5000 ----> 5000.00 如果5000.985 ----> 5000.99如何将MVC 4中的值四舍五入为小数点后两位。
总是应该有两位小数。
这是我的模特班。
[Display(Name = "Price (Rs.)")]
public double price { get; set; }
这是我的cshtml页面(查看)。
<div class="display-label">
@Html.DisplayNameFor(model => model.price)
</div>
非常感谢您@Luuk莫雷。你的回答非常有帮助。它正在工作。 :) –