double before1 = 12.5; double after1 = Math.Round(before1); Console.WriteLine(after1.ToString("F1", CultureInfo.CurrentCulture)); decimal before2 = 12.5M; decimal after2 = Math.Round(before2); Console.WriteLine(after2.ToString("F1", CultureInfo.CurrentCulture));
double outputValue = 0; outputValue = Math.Round(your_decimal_value, 0); Console.WriteLine(string.Format("{0:#0.0}", outputValue));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)