double dblValue = 2222.22220;; Console.WriteLine(dblValue.ToString("N", CultureInfo.InvariantCulture)); // Displays 2,222.22 Console.WriteLine(dblValue.ToString("N1", CultureInfo.CreateSpecificCulture("sv-SE"))); // Displays -12 445,7 int intValue = 123456789; Console.WriteLine(intValue.ToString("N1", CultureInfo.InvariantCulture)); // Displays 123,456,789.0
double value = 22.2222; double result; double.TryParse(value.ToString(), NumberStyles.Any, CultureInfo.InvariantCulture, out result);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)