Skip to content

fix: float string to number parsing #276

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

Merged
merged 1 commit into from
Jun 2, 2025
Merged

Conversation

sagikazarmark
Copy link
Collaborator

Fixes #274

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
@sagikazarmark sagikazarmark merged commit 40e8e07 into master Jun 2, 2025
15 checks passed
@sagikazarmark sagikazarmark deleted the improve-string-float branch June 2, 2025 13:37
Copy link

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apparently forgot to press send ... 🤦‍♂️

Comment on lines +537 to +543
// handle special cases
switch s {
case "-", "+":
s += "0"
case "":
s = "0"
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should explain these cases here, as it's not obvious

Suggested change
// handle special cases
switch s {
case "-", "+":
s += "0"
case "":
s = "0"
}
// handle special cases
switch s {
case "-", "+": // like -.25 or +.25
s += "0"
case "": // like .25
s = "0"
}

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.

String to float regression
2 participants