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

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -