c# - linq sum how to display as currency -
i have following in razor view:
<td>@payments.sum(p => p.amount)</td>
i want display currency have '$' , 2 decimals on end.
i think go {0:c}.
i don't know how incorporate i've got sum not have overload format.
do need css class?
you this:
<td>@string.format("{0:c}", payments.sum(p => p.amount))</td>
Comments
Post a Comment