标签:space ons mes text names read collect lin pac
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
double n = 10.0 / 3;
Console.WriteLine(n);
Console.WriteLine("{0:0.00}", n); //保留两位小数
string str = n.ToString("0.000"); //转成含三位小数的字符串
Console.WriteLine(str);
Console.ReadKey();
}
}
}
输出:
标签:space ons mes text names read collect lin pac
原文地址:https://www.cnblogs.com/zhaiyh/p/11129529.html