C#数字格式化为2位小数

xingyun86 5月前 250

C#数字格式化为2位小数

public static string DoubleFormat(double Value, int NumberDecimalDigits = 2)
{
   return(Value.ToString("N", new System.Globalization.NumberFormatInfo() { NumberDecimalDigits = NumberDecimalDigits, }));
}


×
打赏作者
最新回复 (0)
只看楼主
全部楼主
返回