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

xingyun86 6月前 274

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

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


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