Reputation: 33
Example Value 2.546400000 I want 2.546400
[DisplayFormat(DataFormatString = "{0:n}")]
public decimal? TrackingErrorHigh { get; set; }
Upvotes: 1
Views: 1977
Reputation: 7117
Details can be found here - taken from there:
To Displays numeric values in number format (including group separators and optional negative sign). You can specify the number of decimal places. You use {0:N}
[DisplayFormat(DataFormatString="{0:N6}")]
public decimal? TrackingErrorHigh { get; set; }
Upvotes: 0
Reputation: 30575
[DisplayFormat(DataFormatString="{0:N6}")]
public decimal? TrackingErrorHigh { get; set; }
or custom formatting
[DisplayFormat(DataFormatString="{0:############.000000}")]
public decimal? TrackingErrorHigh { get; set; }
Upvotes: 1