C#格式化输出

double a = 12354.365;

Console.WriteLine(string.Format("{0:f4}", a));

输出a的四位小数

原文地址:https://www.cnblogs.com/XDJjy/p/3646267.html