I have razor code like this :
@Html.DisplayFor(model => item.sepordan_melk_foroshes.ghamat_total)
as a resault it display this :
123.00
how can i remove the last part and show it like this? :
123
I would be so grateful if anyone help me.
I have razor code like this :
@Html.DisplayFor(model => item.sepordan_melk_foroshes.ghamat_total)
as a resault it display this :
123.00
how can i remove the last part and show it like this? :
123
I would be so grateful if anyone help me.
Try this:
@Model.item.sepordan_melk_foroshes.ghamat_total.ToString("N")
@Html.DisplayFor(model => item.sepordan_melk_foroshes.ghamat_total)
Or you can change your model, and add the format decoration to the attribute:
[DisplayFormat(DataFormatString = "{0:N}", ApplyFormatInEditMode = true)]