Can't set display format to 2 decimal places when using mvc6 grid
问题 I need to display some average sums of currency values in my .net core asp mvc project. I am using mvc 6 grid to display the data, and I have tried these solutions: [DisplayFormat(DataFormatString = "{0:C}")] public double? AverageCost { get; set; } [DisplayFormat(DataFormatString = "{0:#.####}")] public double? AverageCost { get; set; } [RegularExpression(@"^\d+\.\d{0,2}$")] public double? AverageCost { get; set; } But still my values are displayed with several decimal places: Am I missing