需要帮助理解 .resx 变量
我正在为我的公司开发一个项目,在跟踪以前编写的代码时,我发现了这一点:
<value>A payment authorization for {0:C} has been received.</value>
{0:C} 是什么意思?我一直在试图找出答案,但没有运气。
I am working on a project for my company, and while tracing previously written code I came upon this:
<value>A payment authorization for {0:C} has been received.</value>
What does {0:C} mean? I have been trying to find out and am having no luck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这只是一个像任何其他字符串一样的字符串。一旦加载到内存中,它将用作
string.Format
的格式参数。{0:C}
只是意味着使用当前的 UI 区域性将数字格式化为货币(或者只是当前的区域性?我永远不记得了)。This is just a string like any other string. Once loaded into memory, it will be used as the format parameter to
string.Format
.{0:C}
just means to format the number as currency using the current UI culture (or is it just current culture? I can never remember).它将数字格式化为货币。
It's formatting a number as currency.