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

推荐订阅源

GbyAI
GbyAI
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
S
Securelist
The Hacker News
The Hacker News
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
AI
AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Schneier on Security
Schneier on Security
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
博客园 - 司徒正美
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
U
Unit 42
V
V2EX
V2EX - 技术
V2EX - 技术
L
LINUX DO - 最新话题
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
P
Privacy & Cybersecurity Law Blog
美团技术团队
小众软件
小众软件
F
Fortinet All Blogs

博客园 - 155144

32.DataReader和output参数的问题 31.动态SQL中使用变量时,可使用存储过程sp_executesql 【求解算法的时间复杂度的具体步骤】 【指数与对数】 30.一个自定义32进制类初稿 【SQL行转列】 29.DataReader相关 【经典SQL语句 】 28.Lc.exe 已退出,代码 -1 27.PowerDesigner中Stereotype的创建 26.UML笔记(UML2.0设计手册) 25.VSS相关 24.GRIDVIEW相关 23.DOTNET中引用相关 22.使用Castle时,如何获取自定义类的单个属性的PropertyAttribute.Column 21-ReSharper UnitRun for .net 20-系统分析与设计(第5版) 19-关于用例的几点知识——摘自《道法自然》 18-概念性系统设计
GridView和DataFormatString
155144 · 2008-12-12 · via 博客园 - 155144

如果DataFormatString无效,请添加属性 HtmlEncode = "false"

---------------------------------------

设定BoundField的DataFormatString,通常有以下几种
DataFormatString= "{0:C}" 货币,货币的格式取决于当前Thread中Culture的设置
DataFormatString= "{0:E}" 科学计数法
DataFormatString= "{0: P}" 百分比
DataFormatString= "{0:F?}" 小数点后几位
DataFormatString= "{0:d}" M/d/yyyy 如 10/30/2008
DataFormatString= "{0:f}" 长日期,短时间。dddd,MMMM dd,yyyy HH:mm aa 如, Monday, January30, 2008 10:00am
DataFormatString= "{0: D}" 长日期。dddd,MMMM dd,yyyy 如: Monday,January 30,2008
DataFormatString= "{0:F}" 长日期,长时间 dddd,MMMM dd,yyyy HH:mm:ss aa
DataFormatString= "{0: s}" ISO 标准时间。yyyy-MM-ddTHH:mm:ss,如: 2008-01-30T10:20:55am
DataFormatString= "{0:M}" 月份和日期 MMMM dd,如January30
DataFormatString= "{0:G}" 一般格式 M/d/yyyy HH:mm:ss aa

-----------------------------------------------------------------

格式字符串 输入 结果
"{0:C}" 12345.6789 $12,345.68
"{0:C}" -12345.6789 ($12,345.68)
"{0:D}" 12345 12345
"{0:D8}" 12345 00012345
"{0:E}" 12345.6789 1234568E+004
"{0:E10}" 12345.6789 1.2345678900E+004
"{0:F}" 12345.6789 12345.68
"{0:F0}" 12345.6789 12346
"{0:G}" 12345.6789 12345.6789
"{0:G7}" 123456789 1.234568E8
"{0:N}" 12345.6789 12,345.68
"{0:N4}" 123456789 123,456,789.0000
"Total: {0:C}" 12345.6789 Total: $12345.68

常用的日期时间格式:

格式 说明 输出格式
d 精简日期格式 MM/dd/yyyy
D 详细日期格式 dddd, MMMM dd, yyyy
f 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mm
F
完整日期时间格式
(long date + long time)
dddd, MMMM dd, yyyy HH:mm:ss
g 一般格式 (short date + short time) MM/dd/yyyy HH:mm
G 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ss
m,M 月日格式 MMMM dd
s 适中日期时间格式 yyyy-MM-dd HH:mm:ss
t 精简时间格式 HH:mm
T 详细时间格式 HH:mm:ss

_____________________________________________________________________________________
COPYRIGHT©2008,HTTP://ZEROBUG.CNBLOGS.COM .ALL RIGHTS RESERVED.