Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

isNumeric does not handle Scientific Notation #2463

Closed
PAllisonVSO opened this issue Sep 30, 2024 · 3 comments · May be fixed by #2467
Closed

isNumeric does not handle Scientific Notation #2463

PAllisonVSO opened this issue Sep 30, 2024 · 3 comments · May be fixed by #2467
Labels

Comments

@PAllisonVSO
Copy link

Describe the bug
A clear and concise description of what the bug is.
Scientific Notation values such as 3.6379788070917e-12 are not considered numeric by isNumeric

This may be best as part of the no symbols option, to allow 'e' if no_symbols is false.

Examples
If applicable, add screenshots to help explain your problem.
const value = Number('3.6379788070917e-12'); isNumeric(value.toString());

returns false, but should return true.

Reproductions
If applicable, provide a reproduction on platforms like runkit

Additional context
Validator.js version:
Node.js version:
OS platform: [windows, linux, macOS, etc]

@jmlavoier
Copy link

There is another PR to solve the same issue.
#2447

@PAllisonVSO
Copy link
Author

Thanks, apparently my search-fu was not good enough.

@PAllisonVSO
Copy link
Author

PR to resolve this issue: #2447

# for free to join this conversation on GitHub. Already have an account? # to comment