1

Example Value 2.546400000 I want 2.546400

[DisplayFormat(DataFormatString = "{0:n}")]
public decimal? TrackingErrorHigh { get; set; }
5
  • It's really unclear what you're asking here. Where are you displaying the data? Is this an ASP.NET MVC view? Commented Sep 18, 2020 at 8:47
  • Here, I want to Display 6 digits for decimal number Commented Sep 18, 2020 at 8:49
  • learn.microsoft.com/en-us/dotnet/api/… Commented Sep 18, 2020 at 8:51
  • Does this answer your question? c# - Show a decimal to 6 decimal places Commented Sep 18, 2020 at 8:56
  • I think there is a already around ~5 questions from displaying decimal for each possible number of digits. Commented Sep 18, 2020 at 8:59

2 Answers 2

1
[DisplayFormat(DataFormatString="{0:N6}")]
public decimal? TrackingErrorHigh { get; set; }

or custom formatting

[DisplayFormat(DataFormatString="{0:############.000000}")]
public decimal? TrackingErrorHigh { get; set; }
Sign up to request clarification or add additional context in comments.

Comments

0

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; }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.