While parsing the string to double we are facing a issue. we need to convert 18 digit string(<123,456,789,012>.<123456>) to double. It returns only 5 digits after the decimal. When we tried to reducing the no of digits, it worked fine. We have attached the screenshot with three different scenarios. Variable 'S' is the input and retValue is the output value.
Kindly help us in converting 123,456,789,012.123456 to 123456789012.123456
string s = "123,456,789,012.123456";
double retVal;
System.Globalization.CultureInfo cInfo = new System.Globalization.CultureInfo(System.Web.HttpContext.Current.Session["culture"].ToString());
retVal = double.Parse(s, NumberStyles.Any, cInfo);