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

Add a way to test that a string represents a valid decimal value #24

Open
mathieuprog opened this issue Nov 25, 2023 · 1 comment
Open

Comments

@mathieuprog
Copy link

In the case I need to use user input, I must first check if it's a valid value before creating a new Decimal instance, or else an error is thrown.

I was expecting a static function allowing to test the validity of a string, e.g.:

Decimal.isValid(userInput)

Of course I could try/catch on an error, but an isValid static function is cleaner and simpler.

@MikeMcl
Copy link
Owner

MikeMcl commented Nov 28, 2023

Okay, I will consider it. Thanks for your input.

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

No branches or pull requests

2 participants