Skip to content
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

Round Trip Format Example - Outdated code sample or no longer needed? #41766

Open
BenjaminMichaelis opened this issue Jul 15, 2024 · 3 comments
Assignees
Labels
doc-bug Problem with the content; needs to be fixed [org][type][category] dotnet-fundamentals/svc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. Pri1 High priority, do before Pri2 and Pri3 📌 seQUESTered Identifies that an issue has been imported into Quest.

Comments

@BenjaminMichaelis
Copy link
Contributor

BenjaminMichaelis commented Jul 15, 2024

Type of issue

Code doesn't work

Description

For https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#round-trip-format-specifier-r , It shows a code example for using the round trip format specifier R on a double; however the code example has a comment at the end of the expected output. However; in my testing it has a result like this:
image

2 questions:

  1. Is the sample code now incorrect since Update the double/float formatters to return the shortest roundtrippable string. coreclr#22040 and .ToString() by default is round-trip compatible? Maybe adbb5e9 just didn't change enough?
  2. When is a necessary use for the round-trip format specifier now (maybe for some data types; but doesn't seem like it is necessary for decimal anymore).

Page URL

https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings

Content source URL

https://github.com/dotnet/docs/blob/main/docs/standard/base-types/standard-numeric-format-strings.md

Document Version Independent Id

f23035e0-f271-b48c-f9a9-8582be80b4ad

Article author

@adegeo

Metadata

  • ID: 0ae38fce-fc98-9420-6b0b-ceee4e885f2d
  • Service: dotnet-fundamentals

Associated WorkItem - 294938

@issues-automation issues-automation bot added dotnet-fundamentals/svc Pri1 High priority, do before Pri2 and Pri3 labels Jul 15, 2024
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Jul 15, 2024
@adegeo adegeo added the doc-bug Problem with the content; needs to be fixed [org][type][category] label Aug 7, 2024
@adegeo adegeo self-assigned this Aug 7, 2024
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Aug 7, 2024
@adegeo
Copy link
Contributor

adegeo commented Aug 7, 2024

Hi @BenjaminMichaelis Thank you for catching this. This is indeed a change between .NET Framework and .NET. A lot of the code here in these fundamental areas were written with .NET Framework. So a note in the code results should be placed that shows the difference between the two.

@adegeo adegeo added the 🗺️ reQUEST Triggers an issue to be imported into Quest. label Aug 7, 2024
@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Aug 7, 2024
@sequestor sequestor bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Aug 8, 2024
@BenjaminMichaelis
Copy link
Contributor Author

Thank you for catching this. This is indeed a change between .NET Framework and .NET. A lot of the code here in these fundamental areas were written with .NET Framework. So a note in the code results should be placed that shows the difference between the two.

Out of curiosity, when are format specifiers needed anymore? A lot of the cases seem covered by default, or they are small enough that they really are always round trip compatible. @adegeo

@adegeo
Copy link
Contributor

adegeo commented Aug 13, 2024

I think a lot of that has to relate to ISO computing standards for information transmission, or business needs related to currency, security, data integrity, etc. If you need a very specific format for whatever reason, you need it. There are so many industries that have all sorts of odd requirements, whether cultural, historical, economical, or whatever. I've worked in a few where I got to see some unique processes related to data transmission and software that I never knew existed, and I've never seen used outside of that one place. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-bug Problem with the content; needs to be fixed [org][type][category] dotnet-fundamentals/svc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. Pri1 High priority, do before Pri2 and Pri3 📌 seQUESTered Identifies that an issue has been imported into Quest.
Projects
Status: 🔖 Ready
Development

No branches or pull requests

3 participants