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

推荐订阅源

Martin Fowler
Martin Fowler
爱范儿
爱范儿
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
IT之家
IT之家
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
Microsoft Azure Blog
Microsoft Azure Blog
The GitHub Blog
The GitHub Blog
C
Check Point Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - Franky
G
Google Developers Blog
V
V2EX
雷峰网
雷峰网
美团技术团队
博客园 - 【当耐特】
人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
J
Java Code Geeks

博客园 - John Rambo

定时关机脚本 Mean shift算法处理图像(Scilab & C#) Arimoto–Blahut algorithm (Mathematica) 1分钟搞定QuickSort算法 C#行列式计算程序 MIDL语法详解 (译) Virtual PC2007 + Redhat9下的网络配置 Total KMP 分析函数调用的汇编指令 why c++/cli About double-checked locking 对透明代理源码的一些理解 ReaderWriterLockSlim CallContext类 GDI+ is F**king unbelievable A better timer 第一个Postsharp插件 WeakReference System. ThreadStaticAttribute
关于IFromatterProvider
John Rambo · 2009-07-31 · via 博客园 - John Rambo

传递给基元类型的ToString(…IFormatterProvider…)应该是CultureInfo或者是NumberFormatInfo,最终只能是NumberFormatInfo

ICustomFormatter这么个接口,但是没有一般性的IFormatter接口。因此一般来说IFormatterProvider实例返回的对象仅仅是一个普通的Object,这个Object中蕴含的某种格式化的信息,而如何利用这种信息只有使用这个格式化信息的对象知道。而一个对象只能使用有限中格式化信息,因此有可能出现传递的包含格式化信息Object不符合要被格式化信息要求的情况,这时此格式化信息将被某种默认的格式化信息取代。

不是所有接受IFormatterProvider接口的地方都支援ICustomFormatter的使用。目前知道String.FormatStringBuilder.AppendFormat支持。也就是说对字符的格式化支持使用自定义的Formatter

yes im back!