DisplayDouble

        public static string DisplayDouble(this double value, int precision)
        {
            return value.ToString("N" + precision);
        }
Example:
double number = 2.2365;

string display = number.DisplayDouble(2); // 2.24

Description

Converts a Double to a String with precision

Details

Double click on the code to select all.

 

;