public static string GetNumericFormat(double value, int digit = 2, int percent = 1) { System.Globalization.NumberFormatInfo provider = new System.Globalization.NumberFormatInfo(); provider.PercentDecimalDigits = digit;//小数点保留几位数. provider.PercentPositivePattern = percent;//百分号出现在何处. return value.ToString("P", provider); }