using System;
using System.Globalization;class NumberFormatInfoSample { public static void Main() { // Gets a NumberFormatInfo associated with the en-US culture.
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat; // Displays a value with the default separator (".").
Int64 myInt = 123456789;
Console.WriteLine( myInt.ToString( "C", nfi ) ); // Displays the same value with a blank as the separator.
nfi.CurrencyDecimalSeparator = " ";
Console.WriteLine( myInt.ToString( "C", nfi ) ); }
}
/*
This code produces the following output.$123,456,789.00
$123,456,789 00
*/
using System.Globalization;class NumberFormatInfoSample { public static void Main() { // Gets a NumberFormatInfo associated with the en-US culture.
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat; // Displays a value with the default separator (".").
Int64 myInt = 123456789;
Console.WriteLine( myInt.ToString( "C", nfi ) ); // Displays the same value with a blank as the separator.
nfi.CurrencyDecimalSeparator = " ";
Console.WriteLine( myInt.ToString( "C", nfi ) ); }
}
/*
This code produces the following output.$123,456,789.00
$123,456,789 00
*/
解决方案 »
- 静态加载tree 问题
- 新人提问,关于系统支持断点续传
- 请教怎么样序列化集合? 望高手指点
- C#中怎么用ComboBox实现style,谢谢。
- 学生管理系统的用户登陆问题
- 请问在C#的FORM情况下,如何把图片上传到服务器的一个文件夹下,而数据库只是记录图片的地址。谢谢
- 怎样把textBox填入的数字转换成int型
- 如何用c#截取屏幕的位图?如何用C#对其它窗口模拟按键按鼠标(就像sendmessage一样)?
- 求教C#调用java,我不了解要连的这个java是什么性质的,这是别人的java代码,我把java的代码也贴出来,请教我用C#去用,谢谢
- 用FinControl可以找到一个子控件,那么是否有类似的方法可以找到一个Component的子类实例?
- 说是转换无效`搞老大半天了`就是没咋见效`如有高手看到`请你救救我了
- C#中有没有左、右截取指定长度子字符串的方法?
Response.Write(MyDouble.ToString("###,###"));
Response.Write(MyDouble.ToString("N0"));