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

Making numerical formatting specifiers more consistent #67623

Closed
stephentoub opened this issue Apr 5, 2022 · 2 comments · Fixed by #67959
Closed

Making numerical formatting specifiers more consistent #67623

stephentoub opened this issue Apr 5, 2022 · 2 comments · Fixed by #67959
Labels
area-System.Numerics help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@stephentoub
Copy link
Member

Today 'R'/'r' aren't supported with integral types but are with floating point, and 'X'/'x' aren't supported with floating point but are with integral types. Related to both #65634 and the generic math support, where INumber<T> inherits ISpanFormattable and thus we should expect format specifiers to be used with arbitrary numerical types, we should allow all of these specifiers to be used, regardless of integer vs floating point. 'R'/'r' for integers can just be treated as 'G'/'g', respectively, and 'X'/'x' for floating point is covered by #1630.

(Discussed in API review on 4/5/2022.)

cc: @tannergooding

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Numerics untriaged New issue has not been triaged by the area owner labels Apr 5, 2022
@ghost
Copy link

ghost commented Apr 5, 2022

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

Issue Details

Today 'R'/'r' aren't supported with integral types but are with floating point, and 'X'/'x' aren't supported with floating point but are with integral types. Related to both #65634 and the generic math support, where INumber<T> inherits ISpanFormattable and thus we should expect format specifiers to be used with arbitrary numerical types, we should allow all of these specifiers to be used, regardless of integer vs floating point. 'R'/'r' for integers can just be treated as 'G'/'g', respectively, and 'X'/'x' for floating point is covered by #1630.

(Discussed in API review on 4/5/2022.)

cc: @tannergooding

Author: stephentoub
Assignees: -
Labels:

area-System.Numerics, untriaged

Milestone: -

@tannergooding tannergooding added help wanted [up-for-grabs] Good issue for external contributors and removed untriaged New issue has not been triaged by the area owner labels Apr 11, 2022
@tannergooding tannergooding added this to the 7.0.0 milestone Apr 11, 2022
@tannergooding
Copy link
Member

tannergooding commented Apr 11, 2022

This one should be relatively straightforward for R, it just needs to be treated the same as G for the built-in Integer types.

The hexadecimal support for floating-point types is a bit more complex (namely due to handling a different set of suffixes) but is tracked by #1630.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Apr 13, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Apr 14, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Numerics help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants