I am applying in the model the DataformatString I wish that in the price of the products appear the cost separated by thousands with one (,) and that it appears without decimals. I was able to make decimals not appear but not to show the thousands separated by (,) since they appear separated by (.) And it seems to indicate cents instead of thousands.
Model
[DisplayFormat(DataFormatString = "{0:$#,#}")]
public double Price { get; set; }
Html
Precio: @Html.DisplayFor(Model => Model.Products.ElementAt(i).Price) MXN
APPEARS
Price: $ 17,572 MXN
My interest is to appear as follows
Price: $ 17,572 MXN
Before in the model I would put it in the following way if I remember correctly
[DisplayFormat(DataFormatString = "{0:C0}")]
public double Price { get; set; }
but the currency appeared in Euros and I need it in Mexican currency and thousands to appear with commas and without decimals.
I hope you can help me:).