Closed. This question needs details or clarity。它当前不接受答案。
想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
5年前关闭。
我首先需要。(点),然后是逗号(,)。
例如1234567这是一个示例数字或货币
我想要像1.234.567,00
谁能给我答案。
xyz = 1.234.567,000
想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
5年前关闭。
我首先需要。(点),然后是逗号(,)。
例如1234567这是一个示例数字或货币
我想要像1.234.567,00
谁能给我答案。
最佳答案
这看起来像外币格式。根据您的实际需求,可能有多种方法可以执行此操作。以下MSDN链接为您提供了完整的文档:
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx#CFormatString
一个有效的示例如下:
string xyz = "1234567";
// Gets a NumberFormatInfo associated with the en-US culture.
NumberFormatInfo nfi = new CultureInfo("en-US", false).NumberFormat;
nfi.CurrencyDecimalSeparator = ",";
nfi.CurrencyGroupSeparator = ".";
nfi.CurrencySymbol = "";
var answer = Convert.ToDecimal(xyz).ToString("C3",
nfi);
xyz = 1.234.567,000
10-04 16:18