Reputation: 1059
I have created a table for tax ranges. Now I want to display the amounts formatted like so: $100,000
. How can I do this?
Upvotes: 35
Views: 45423
Reputation: 335
You could add this in your model, the currency symbol will be displayed anytime you reference that field
[DisplayFormat(DataFormatString = "{0:C}", ApplyFormatInEditMode = true)]
public decimal DebitAmount { get; set; }
Upvotes: 21
Reputation: 985
You could try this format, and replace amount with custom value.
@string.Format("{0:C}", amount);
Upvotes: 66