Skip to content

isNumeric doesn't support scientific notation #2430

Open
@benada002

Description

@benada002

Describe the bug
👋 Not sure if you consider this a 🐛, but I just noticed that isNumeric doesn't support scientific notation. Eg. this works perfectly fine (returns true):

const testNumber = (200000000000000000000).toString()
validator.isNumeric(testNumber)

But this returns false, even through it's a valid number

// Results in "2e+21"
const testNumberFailing = (2000000000000000000000).toString()
validator.isNumeric(testNumberFailing)

Examples
image

Reproductions
https://runkit.com/embed/xsw1bpnhjcgs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions