.NET Framework
Show an int, double, or decimal as US currency. This will add the dollar sign, the comma separators and 2 decimal places.
public static string DisplayCurrency(int value)
{
return DisplayCurrency((decimal)value);
}
public static string DisplayCurrency(double value)
{
return DisplayCurrency((decimal)value);
}
public static string DisplayCurrency(decimal value)
{
return string.Format(System.Globalization.CultureInfo.GetCultureInfo(1033), "{0:C}", value);
}