c# - Parsing a string with a number on basis of culture -
i working on application extracts numbers strings based on different cultures. here's method:
private decimal parsecurrencyamount(string fieldvalue, string clientculture) { decimal decimalvalue; if (decimal.tryparse(fieldvalue, numberstyles.currency, cultureinfo.getcultureinfo(clientculture), out decimalvalue)) { return decimalvalue; } return -1; }
the string 40'000 40,000 in swiss french culture not able parse same. there other culture can parse string correctly?
input: fieldvalue : "40'000" (forty thousand) clientculture : fr-ch not working can change culture. tia
Comments
Post a Comment