Console.WriteLine(
string.Format("{0:#,0.00;(#,0.00);-}", -1234.56));
// (1,234.56)
Console.WriteLine(
string.Format("{0:#,0.00;(#,0.00);-}", 1234.56));
// 1,234.56
Console.WriteLine(
string.Format("{0:#,0.00;(#,0.00);-}", 0));
// -
原文
MSDN 自訂數值格式字串
沒有留言:
張貼留言