CSharp examples for System:Double
Format Double and round
using System.Web; using System.Linq; using System.Collections.Generic; using System;/*www . j ava 2 s .c o m*/ public class Main{ public static String FormatDouble(double d, int decimalPlaces) { return Convert.ToString(Math.Round(d, 2), System.Globalization.CultureInfo.InvariantCulture); } public static String FormatDouble(double d) { return Convert.ToString(d, System.Globalization.CultureInfo.InvariantCulture); } }