Skip to content
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

Decimal.isValid() ? #165

Open
QnoraeT opened this issue Apr 20, 2024 · 0 comments
Open

Decimal.isValid() ? #165

QnoraeT opened this issue Apr 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@QnoraeT
Copy link

QnoraeT commented Apr 20, 2024

I feel like it'll be useful if there was a way to check if strings, when attempting to convert into a Decimal, is valid
maybe there is a better way to check if a string is valid when converted into a decimal, that i haven't found yet, because from what i know, it either results in NaN, or 0 (and i would like to filter out the NaN values)

maybe either this or invalid strings automatically turn into NaN ?

Decimal.isValid("1.208e38") == true
Decimal.isValid("e6.773e19") == true
Decimal.isValid("10^49") == true
Decimal.isValid("p1.208e38") == false
Decimal.isValid("Reach 15") == false
Decimal.isValid("m57") == false
@MathCookie17 MathCookie17 added the enhancement New feature or request label Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants