I am working on an application which extracts numbers from strings based on different cultures. Here's my 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 is 40,000 in swiss french culture however I am not able to parse the same. Is there any other culture which can parse this string correctly?
Input: fieldValue : "40'000" (forty thousand) clientCulture : fr-CH not working but I can change the culture. TIA