Skip to content

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

@mathieuprog

Description

@mathieuprog

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions