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

[core:fmt] Incorrect Forced Sign Placement When Zero Padding on Positive Integers #4715

Closed
dozn opened this issue Jan 18, 2025 · 0 comments · Fixed by #4745
Closed

[core:fmt] Incorrect Forced Sign Placement When Zero Padding on Positive Integers #4715

dozn opened this issue Jan 18, 2025 · 0 comments · Fixed by #4745

Comments

@dozn
Copy link
Contributor

dozn commented Jan 18, 2025

Context

package main
import "core:fmt"
main :: proc() {
  fmt.printfln("|%+ 3d", -9) // | -9
  fmt.printfln("|%+03d", -9) // |-09
  fmt.printfln("|%+ 3d",  9) // | +9
  fmt.printfln("|%+03d",  9) // |0+9  <--
}

Expected Behaviour

fmt.printfln("|%+03d", 9) should output |+09, while maintaining the output above for the other cases.


Odin: dev-2025-01:16eca1ded
OS: Windows 11 Professional (version: 23H2), build 22631.4751
CPU: AMD Ryzen 7 3700X 8-Core Processor
RAM: 65457 MiB
Backend: LLVM 18.1.8

@dozn dozn changed the title [core:fmt] Different [core:fmt] Incorrect Zero Padding on Positive Integers with Forced Sign Jan 18, 2025
@dozn dozn changed the title [core:fmt] Incorrect Zero Padding on Positive Integers with Forced Sign [core:fmt] Incorrect Forced Sign Placement When Zero Padding on Positive Integers Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant