using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
namespace ConvertDemo
{
internal class Program
{
static void Main(string[] args)
{
float a = 10.156f;
string s = a.ToString("f1");//保留小数点后1位
string s2 = a.ToString("f2");//保留小数点后2位
Console.WriteLine(s);
Console.WriteLine(s2);
}
}
}
07-28
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交