/*
* 由SharpDevelop创建。
* 用户: Administrator
* 日期: 2019/08/28
* 时间: 09:40
*
* 给数值添加千分位
*
* 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
*/
using System;
using System.Text.RegularExpressions;
namespace test2
{
class Program
{
public static void Main(string[] args)
{
double n =Convert.ToDouble(Console.ReadLine());
Console.WriteLine(nuber(n));
Console.ReadKey();
}
private static String nuber(double n)
{
// string str = DecimalFormat.getNumberInstance().format(n);
string str =n.ToString("N");
if (str.IndexOf(".") > 0) {
str =Regex.Replace(str.Trim(),"0+?$", " ");
str =Regex.Replace(str.Trim(),"[.]$", " ");
}
return str;
}
}
}