惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
H
Heimdal Security Blog
K
Kaspersky official blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Schneier on Security
G
GRAHAM CLULEY
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
C
Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
Security Archives - TechRepublic
Security Archives - TechRepublic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
V
Visual Studio Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Jina AI
Jina AI
P
Proofpoint News Feed
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog
IT之家
IT之家
S
Security Affairs
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
N
News | PayPal Newsroom
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
NISL@THU
NISL@THU

博客园 - 朱小能

C#对Dictionary的按Value排序 linq to sql中的自动缓存(对象跟踪) javascript 调用webservice 的几种方法 修改域名映射IP地址 SQL 语句,类型转换 hyper-v 网络连接 VS2010 定位文件在solution中的位置 oracle连接字符串配置 spool的简单使用 open数据库Timeout expired 错误 文件的还原与备份 - 朱小能 - 博客园 ASCII码,对应e.KeyChar C# 调用计算器,日历 - 朱小能 - 博客园 Excel 如何由一个文本算术公式得到一个结果 Word、Excel中输入当前日期及时间的快捷键 GridView绑定 获取access中表的相关信息 Filelog - 朱小能 - 博客园 List<T> 排序 - 朱小能 - 博客园
c# ToString 格式化数字 - 朱小能
朱小能 · 2010-09-26 · via 博客园 - 朱小能
double[] numbers= {1054.32179, -195489100.8377, 1.0437E21, 
                   -1.0573e-05};
string[] specifiers = { "C", "E", "e", "F", "G", "N", "P", 
                        "R", "#,000.000", "0.###E-000"};
foreach (double number in numbers)
{
   Console.WriteLine("Formatting of {0}:", number);
   foreach (string specifier in specifiers)
      Console.WriteLine("   {0,5}: {1}", 
                        specifier, number.ToString(specifier));

   Console.WriteLine();
}
// The example displays the following output to the console:
//       Formatting of 1054.32179:
//              C: $1,054.32
//              E: 1.054322E+003
//              e: 1.054322e+003
//              F: 1054.32
//              G: 1054.32179
//              N: 1,054.32
//              P: 105,432.18 %
//              R: 1054.32179
//          #,000.000: 1,054.322
//          0.###E-000: 1.054E003
//       
//       Formatting of -195489100.8377:
//              C: ($195,489,100.84)
//              E: -1.954891E+008
//              e: -1.954891e+008
//              F: -195489100.84
//              G: -195489100.8377
//              N: -195,489,100.84
//              P: -19,548,910,083.77 %
//              R: -195489100.8377
//          #,000.000: -195,489,100.838
//          0.###E-000: -1.955E008
//       
//       Formatting of 1.0437E+21:
//              C: $1,043,700,000,000,000,000,000.00
//              E: 1.043700E+021
//              e: 1.043700e+021
//              F: 1043700000000000000000.00
//              G: 1.0437E+21
//              N: 1,043,700,000,000,000,000,000.00
//              P: 104,370,000,000,000,000,000,000.00 %
//              R: 1.0437E+21
//          #,000.000: 1,043,700,000,000,000,000,000.000
//          0.###E-000: 1.044E021
//       
//       Formatting of -1.0573E-05:
//              C: $0.00
//              E: -1.057300E-005
//              e: -1.057300e-005
//              F: 0.00
//              G: -1.0573E-05
//              N: 0.00
//              P: 0.00 %
//              R: -1.0573E-05
//          #,000.000: 000.000
//          0.###E-000: -1.057E-005
 
  
  1.   
  2.       
  3.   
  4.     this.TextBox7.Text = System.DateTime.Now.ToString("d");   
  5.   
  6.   
  7.   
  8.       
  9.   
  10.     this.TextBox8.Text = System.DateTime.Now.ToString("F");   
  11.   
  12.       
  13.   
  14.     this.TextBox9.Text = System.DateTime.Now.ToString("f");   
  15.   
  16.   
  17.   
  18.       
  19.   
  20.     this.TextBox10.Text = System.DateTime.Now.ToString("G");   
  21.   
  22.       
  23.   
  24.     this.TextBox11.Text = System.DateTime.Now.ToString("g");   
  25.   
  26.   
  27.   
  28.       
  29.   
  30.     this.TextBox12.Text = System.DateTime.Now.ToString("T");   
  31.   
  32.       
  33.   
  34.     this.TextBox13.Text = System.DateTime.Now.ToString("t");   
  35.   
  36.   
  37.   
  38.       
  39.   
  40.     this.TextBox14.Text = System.DateTime.Now.ToString("U");   
  41.   
  42.       
  43.   
  44.     this.TextBox15.Text = System.DateTime.Now.ToString("u");   
  45.   
  46.   
  47.   
  48.       
  49.   
  50.     this.TextBox16.Text = System.DateTime.Now.ToString("m");   
  51.   
  52.     this.TextBox16.Text = System.DateTime.Now.ToString("M");   
  53.   
  54.       
  55.   
  56.     this.TextBox17.Text = System.DateTime.Now.ToString("r");   
  57.   
  58.     this.TextBox17.Text = System.DateTime.Now.ToString("R");   
  59.   
  60.       
  61.   
  62.     this.TextBox19.Text = System.DateTime.Now.ToString("y");   
  63.   
  64.     this.TextBox19.Text = System.DateTime.Now.ToString("Y");   
  65.   
  66.       
  67.   
  68.     this.TextBox20.Text = System.DateTime.Now.ToString("o");   
  69.   
  70.     this.TextBox20.Text = System.DateTime.Now.ToString("O");   
  71.   
  72.       
  73.   
  74.     this.TextBox18.Text = System.DateTime.Now.ToString("s");   
  75.   
  76.       
  77.   
  78.     this.TextBox21.Text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff");   
  79.   
  80.       
  81.   
  82.     this.TextBox22.Text = System.DateTime.Now.ToString("yyyy年MM月dd HH时mm分ss秒");   
  83.   
  84.   
  85.   
  86.   
  87.   
  88.       
  89.   
  90.     this.TextBox1.Text = System.DateTime.Now.ToString("dddd, MMMM dd yyyy");   
  91.   
  92.       
  93.   
  94.     this.TextBox2.Text = System.DateTime.Now.ToString("ddd, MMM d \"'\"yy");   
  95.   
  96.       
  97.   
  98.     this.TextBox3.Text = System.DateTime.Now.ToString("dddd, MMMM dd");   
  99.   
  100.       
  101.   
  102.     this.TextBox4.Text = System.DateTime.Now.ToString("M/yy");   
  103.   
  104.       
  105.   
  106.     this.TextBox5.Text = System.DateTime.Now.ToString("dd-MM-yy");   
  107.   
  108.   
  109.   
  110. 字符型转换 转为字符串   
  111.   
  112.     12345.ToString("n");   
  113.   
  114.     12345.ToString("C");   
  115.   
  116.     12345.ToString("e");   
  117.   
  118.     12345.ToString("f4");   
  119.   
  120.     12345.ToString("x");   
  121.   
  122.     12345.ToString("p");