【发布时间】:2016-03-10 21:46:38
【问题描述】:
我已经学会了如何使用 C2 以货币格式显示字符串变量。但是我怎么能以欧元等其他货币显示。
下面是我的基础代码
Console.WriteLine("\nHere is the same value displayed in currency form: " + value.ToString("C2"));
【问题讨论】:
-
还有
Console.WriteLine(string.Format("{0}Here is the same value displayed in currency form: {1}", Environment.NewLine, value.ToString("C2"))); -
@BobKaufman - 我认为这些是更接近的副本,因为它们是特定于 .Net 的:String format currency 和 Format decimal as currency based on currency code。