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

推荐订阅源

博客园_首页
MongoDB | Blog
MongoDB | Blog
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
D
Docker
云风的 BLOG
云风的 BLOG
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
GbyAI
GbyAI
T
Tailwind CSS Blog
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
C
Check Point Blog
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
N
Netflix TechBlog - Medium
B
Blog RSS Feed
腾讯CDC
aimingoo的专栏
aimingoo的专栏

博客园 - 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!