Conversation
|
@Sergio0694 Whenever you're ready on this |
|
Hi, I'd like to draw the attention to several issues with this PR and would request to consider before merging it. Does the name "USD".IsCurrency == true;
"US Dollar".IsCurrency == true;
"MX".IsCurrency == false;Your use of the word "currency" sounds non-standard. Maybe What is the global / world-wide use case, apart from your specific local use? IMO dealing with currency amounts without regarding the actual currency is a source for disaster. // Default US Currency Format
string.Format(new CultureInfo("en-US"), "{0:C}", 1456.12155) // $1,456.12
// Currency format for Mexico
string.Format(new CultureInfo("es-MX"), "{0:C}", 1456.12155) // 1.456,12 Mex$Please never ever write such code in a public application! If a price is 1,456.12 US Dollars, a customer cannot just pay 1.456,12 Mexican Pesos instead, just because he changed the language in his browser or operating system! |
Closes #72.
Adds an
IsCurrencyextension method to StringExtensions that bundles an easy and obvious check for if a string is a valid currency, similar toIsDecimal.