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

printf format specifier with zero padding behaves incorrectly for negative zero (-0.0) on .NET Core #15558

Open
jwosty opened this issue Jul 5, 2023 · 1 comment
Labels
Area-Library Issues for FSharp.Core not covered elsewhere Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone

Comments

@jwosty
Copy link
Contributor

jwosty commented Jul 5, 2023

printf formatting a value of -0.0 with %010f (or anything which adds some zero padding) incorrectly places the - symbol.

Expected behavior

sprintf "%010.3f" -0.0 should display -00000.000 sprintf "%010.3f" -0.0 should display 00000.000 (to match .NET Framework).

This works correctly for other negative values. For example, sprintf "%010.3f" -0.01 displays -00000.100.

Actual behavior

Displays 0000-0.000

Known workarounds

None known.

Related information

Potentially related to: #15557

  • macOS 12.6
  • .NET 6.0.15
@github-actions github-actions bot added this to the Backlog milestone Jul 5, 2023
@0101 0101 added Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. Area-Library Issues for FSharp.Core not covered elsewhere and removed Needs-Triage labels Jul 10, 2023
@jwosty
Copy link
Contributor Author

jwosty commented Dec 16, 2024

Noting here that this bug only affects FSharp.Core under .NET Core. See: #18147 (comment)

@jwosty jwosty changed the title printf format specifier with zero padding behaves incorrectly for negative zero (-0.0) printf format specifier with zero padding behaves incorrectly for negative zero (-0.0) on .NET Core Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Library Issues for FSharp.Core not covered elsewhere Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Projects
Status: New
Development

No branches or pull requests

2 participants