I am using ASP.NET Core v2,
See picture showing SQL data type and the code in the model
I do not want to display decimal if there are no decimals
The following html is used to show the input on web page
<input tabindex=@ordTab asp-for="@Model.OrderLineList[i].NoInvoAb" />
below is SQL
below is the model
I have tried many different display formats/dataformatstring but it does not seem to matter what I use, like the formatting does not seem to apply at all
[Required]
[DisplayFormat(DataFormatString = "{0:0}")]
[Display(Name = "Ordered")]
public decimal NoInvoAb { get; set; }
This is my result which is wrong, if the value is 2, it should display 2 and not 2,00
what am I doing wrong