This is a strange one, on most of my systems this code works fine:
var separator = Convert.ToChar(CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator);
DA = Math.Round(double.Parse(M.Groups[1].Value.Replace('.', separator))).ToString();
It brings back a digit like for example: 12.6754645644 so we just round up the M.Groups[1].Value to 12 for example, although it works on most systems in 1 it is throwing an error:
System.FormatException: Input string was not in a correct format. at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
The strange thing is, it works on most systems I have tested on, is there something I am missing here?