Skip to content

fix(js/ts): hex format specifier uses no padding unless precision is specified#4603

Merged
MangelMaxime merged 1 commit into
fable-compiler:mainfrom
sasmithjr:20260513-hex-precision
May 14, 2026
Merged

fix(js/ts): hex format specifier uses no padding unless precision is specified#4603
MangelMaxime merged 1 commit into
fable-compiler:mainfrom
sasmithjr:20260513-hex-precision

Conversation

@sasmithjr
Copy link
Copy Markdown
Contributor

I was updating from v4.29.0 to v5.0.0 and noticed a change in behavior with formatting numbers to hex with no precision defined.

When converting to hex that should be single digit with no precision defined, v5.0.0 started left padding with a "0". This PR makes it so there's no left padding anymore to align with .NET's behavior.

Repro in REPL here, and you can copy/paste the code in to dotnet fsi to see that the output is different.

If you'd like anything adjusted/modified or if you'd like for me to create an issue first, please let me know. Thank you for everything Fable, and thank you for your time!

@MangelMaxime MangelMaxime changed the title fix(js/ts): (int).ToString("X") no longer pads to 2 digits fix(js/ts): hex format specifier uses no padding unless precision is specified May 14, 2026
@MangelMaxime MangelMaxime merged commit ba9857a into fable-compiler:main May 14, 2026
31 checks passed
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 this pull request may close these issues.

2 participants