Home
Manage Your Code
Snippet: Currency format without decimals (C#)
Title: Currency format without decimals Language: C#
Description: Currency format without decimals Views: 224
Author: Filip K Date Added: 11/25/2008
Copy Code  
1System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
2nfi.CurrencyDecimalDigits = 0;
3nfi.CurrencySymbol = "$";
4
5string result = String.Format(nfi,"{0:c}", value);
6
7// or just

8string result = "$ " + value.ToString("#,##0");