Application deals with strings that represent decimals that come from different cultures. For example \"1.1 and \"1,1\" is the same value.
I played with Deci
nice, still it's not 100% correct. when you use the case 1: you automatically suppose, that ',' stands for decimal digit. you should at least check if it occures more than once, cause in that case its a group separating symbol
case 1:
var firstPunctuation = linq.ElementAt(0);
var firstPunctuationOccurence = value.Where(x => x == firstPunctuation).Count();
if (firstPunctuationOccurence == 1)
{
// we assume it's a decimal separator (and not a group separator)
value = value.Replace(firstPunctuation.ToString(), format.NumberDecimalSeparator);
}
else
{
// multiple occurence means that symbol is a group separator
value = value.Replace(firstPunctuation.ToString(), format.NumberGroupSeparator);
}
break;