2015-07-11 195 views

回答

4

您也可以与注释做到这一点。

[DisplayFormat(DataFormatString = "{0:n2}", ApplyFormatInEditMode = true)] 

有关更多信息,请参见this answer

+0

非常感谢您@Luuk莫雷。你的回答非常有帮助。它正在工作。 :) –

2
<div class="display-label"> 
     @Math.Round(model=>model.price, 2) 
</div> 

你最好使用“十进制”而不是“双”

相关问题