-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom format strings with section separators have weird behavior #27472
Comments
Issue was copied from the original discussion on dotnet/coreclr#20109 CC. @jkotas, @danmosemsft, @stephentoub |
I'd appreciate some input on how you feel this should be addressed, either changing the behavior to better match the documentation or updating the documentation to match the behavior. |
I assume that we have these corner cases covered by tests, so that we do not change the behavior by accident. Is that correct? I do not see anything to fix in the product. None of the examples in your table look obviously wrong to me. The examples in https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings#the--section-separator make it clear how these format specifiers are meant to be used. I do not think it is important for the documentation to describe the behavior in corner cases. The documentation is not meant to be a detailed spec. Do you believe that there is anything missing in the documentation that prevents our customers from using this successfully? |
Basically, I would expect each section to build on the previous. So the logic behind things is clear/consistent. |
That would be useful to fix.
Feel free to update the doc. Keep in mind the target audience - these format strings are likely going be used by people used to Excel formatting. |
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process. This process is part of our issue cleanup automation. |
This issue will now be closed since it had been marked |
Currently, there seems to be a lot of "weird" behavior around the section separator and it doesn't seem to be consistent.
For example, from the docs for the "three section" case:
The "two section" case doesn't have any explicit wording on it, but I would imagine it would/should follow the same logic.
For "-1234.0" and various format specifiers, we currently get the following:
""
-1234
";"
-
"#;"
-1234
";#"
1234
"#;#"
1234
";;"
-
"#;;"
-1234
";#;"
1234
";;#"
-
"#;#;"
1234
";#;#"
1234
"#;;#"
-1234
"#;#;#"
1234
";;;"
-
I would expect:
the documentation to give an example of one vs two vs three section separators
;
to be single-section and one;
to be a two-section;
present)The text was updated successfully, but these errors were encountered: