开发者

How to format calculated value as decimal in mvc3/razor/webgrid?

How can I get this to show as a dec开发者_Python百科imal in mvc3/razor/webgrid helper?

grid.Column("DecimalValue", format: @<text>@((@item.SomeInt / @item.SomeInt2))</text>)


You will need to cast to decimal, or you will only do integer arithmetic, which by definition returns an integer.

Not quite sure razor syntax will allow this (if not, use a code block @{})

@(decimal)item.SomeInt / @item.SomeInt2
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜