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 IsCurrency to StringExtensions. #72

Open
Arlodotexe opened this issue Dec 20, 2021 · 0 comments · May be fixed by #73
Open

Add IsCurrency to StringExtensions. #72

Arlodotexe opened this issue Dec 20, 2021 · 0 comments · May be fixed by #73
Labels
common 💼 Issues/PRs for the Common package feature request 📬 A request for new changes to improve functionality

Comments

@Arlodotexe
Copy link
Member

Continuing from Currency validation support #4430.

We'd like to add an IsCurrency extension method to StringExtensions that bundles an easy and obvious check for if a string is a valid currency, similar to IsDecimal.

This would be implemented like so

public static bool IsCurrency([NotNullWhen(true)] this string? str)
{
    return decimal.TryParse(str, NumberStyles.Currency, out _);
}
@Arlodotexe Arlodotexe linked a pull request Dec 20, 2021 that will close this issue
@Sergio0694 Sergio0694 added common 💼 Issues/PRs for the Common package feature request 📬 A request for new changes to improve functionality labels Dec 21, 2021
@Arlodotexe Arlodotexe assigned Sergio0694 and unassigned Sergio0694 Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common 💼 Issues/PRs for the Common package feature request 📬 A request for new changes to improve functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants