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

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -