Reputation: 13357
How can I get this to show as a decimal in mvc3/razor/webgrid helper?
grid.Column("DecimalValue", format: @<text>@((@item.SomeInt / @item.SomeInt2))</text>)
Upvotes: 0
Views: 1093
Reputation: 164291
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
Upvotes: 1