Use the Jcl solution and make it a nice extension:
public static string ToMoney(this object o) { return o.toString("$#,##0.00;$\(#,##0.00\)"); }
Then just name it:
string x = itemPrice.ToMoney();
Or another very simple implementation:
public static string ToMoney(this object o) { // note: this is obviously only good for USD return string.Forma("{0:C}", o).Replace("($","$("); }
naspinski
source share