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

推荐订阅源

Application and Cybersecurity Blog
Application and Cybersecurity Blog
B
Blog RSS Feed
M
MIT News - Artificial intelligence
爱范儿
爱范儿
V
V2EX
雷峰网
雷峰网
D
Docker
美团技术团队
N
Netflix TechBlog - Medium
C
Cisco Blogs
T
Threatpost
K
Kaspersky official blog
P
Privacy International News Feed
W
WeLiveSecurity
T
Tor Project blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 聂微东
F
Full Disclosure
Forbes - Security
Forbes - Security
V
Vulnerabilities – Threatpost
I
Intezer
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google Online Security Blog
Google Online Security Blog
The Register - Security
The Register - Security
GbyAI
GbyAI
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
人人都是产品经理
人人都是产品经理
SecWiki News
SecWiki News
Cyberwarzone
Cyberwarzone
Vercel News
Vercel News
罗磊的独立博客
The Hacker News
The Hacker News
腾讯CDC
S
Security @ Cisco Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
WordPress大学
WordPress大学
Recorded Future
Recorded Future
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 【当耐特】
小众软件
小众软件
Hacker News: Ask HN
Hacker News: Ask HN
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Security Affairs
C
Check Point Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org

博客园 - 暮江独钓

无数据库日志文件恢复数据库方法两则[转自www.sql2005.com.cn] C# Tostring() 格式大全 [转] - 暮江独钓 C#数值结果表(格式化字符串) - 暮江独钓 - 博客园 T-SQL循环打印一年中所有的日期(WHILE循环) SQL Server各种日期计算方法(收藏) ado.net 如何读取 excel (转贴) C#编码标准--编码习惯 发布一个很COOL的图片验证码程序[含源码](转) 怎么在框架窗口中退出 c#取机器码 [转] VS2005如果使用Forms驗證,Login頁面不能引用工程中CSS和IMG文件解決方案 [转] ASP.NET几种安全验证方法[转] 最近一直在做C#操作office方面的工作!总结一下!Word(二) [转] 使用C#自动生成Word2003文档(通过操作COM组件实现) [转] C#中对Web.config配置文件的操作(增删改读) [转] ASP.NET在线用户列表精确版——解决用户意外退出在线列表无法及时更新问题 Cookie与自动保存 [ASP.NET] 如何在GridView中使用DataFromatString DataFormatString格式字符串
Use ToString() to format values
暮江独钓 · 2008-01-25 · via 博客园 - 暮江独钓

/*
C#: The Complete Reference 
by Herbert Schildt 

Publisher: Osborne/McGraw-Hill (March 8, 2002)
ISBN: 0072134852
*/


// Use ToString() to format values. 
 
using System; 
 
public class ToStringDemo 
  public static void Main() { 
    double v = 17688.65849
    double v2 = 0.15
    int x = 21
  
    string str = v.ToString("F2")
    Console.WriteLine(str)
 
    str = v.ToString("N5")
    Console.WriteLine(str)
 
    str = v.ToString("e")
    Console.WriteLine(str)
 
    str = v.ToString("r")
    Console.WriteLine(str)
 
    str = v2.ToString("p")
    Console.WriteLine(str)
 
    str = x.ToString("X")
    Console.WriteLine(str)
 
    str = x.ToString("D12")
    Console.WriteLine(str)
 
    str = 189.99.ToString("C")
    Console.WriteLine(str)
  
}

posted @ 2008-01-25 10:27  暮江独钓  阅读(310)  评论()    收藏  举报