2016-07-05 72 views

回答

1

使用的String.Format要做到這一點,例如:

// Output will be 555,448,999.513 
string s = string.Format(new CultureInfo("en-US"), "{0:n3}", 555448999.513); 
1

String.Format的另一種顯示方式。 without CultureInfo

decimal v = 123018401398.313m; 
Console.WriteLine(string.Format("{0:0,000.00}", v)); 
// Output is 123,018,401,398.31 

請注意,您需要指定小數計數。此示例僅顯示2.

相關問題