今天看到的實用 tips
Console.WriteLine(string.Format("{0:#,0.00;(#,0.00);-}", -1234.56));
//Get (1,234.56)
Console.WriteLine(string.Format("{0:#,0.00;(#,0.00);-}", 1234.56));
//Get 1,234.56
Console.WriteLine(string.Format("{0:#,0.00;(#,0.00);-}", 0));
//Get -
因為小弟工作要跟金融業打交道,所以相當實用啊!
因為我有潔癖,所以這可以省去我一些麻煩啊~
我為什麼沒早發現這麼強大的事情!
這樣寫比較漂亮啊!
Written by 小叮噹文青
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#.net
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#