In my Postgres DB, I have a column for vatrate with the following values
9, 23, 0 and 13.5
They are set as numeric, with only 1 decimal place, and my ViewModel has the following annotation for that FK column
//for vat rate
[DisplayFormat(DataFormatString = "{0:0.#}", ApplyFormatInEditMode = true)]
public Guid? vat_guid { get; set; }
In my view I have the following code for the dropdownlist
@Html.DropDownList("vat_guid", null, htmlAttributes: new { @class = "form-control" })
In my controller I have
ViewBag.vat_guid = new SelectList(db.q_vat, "vat_guid", "q_rate", pagedProduct.SingleOrDefault().vat_guid);
But now my view result for the value with a decimal place is adding 3 extra 0s to that value, and I cannot find whats causing this issue