Skip to content

Parse numbers as either integer or floating type #20

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Guiorgy
Copy link

@Guiorgy Guiorgy commented Jun 29, 2025

Parse numbers as both an integer and a floating point number. Include a number_type field to indicate which of the two is the best match, for those that care, for those that don't, they can just use the floating point (double) value unconditionally for simplicity. This reduces the potential loss of precision when parsing large numbers, for example, 9007199254740993 would be parsed as 9007199254740992.0, however now it is correctly parsed as 9007199254740993 (if the integer field is used).

PS. Also fixed a small typo in the README

also renamed floating -> decimal
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.

1 participant