> Does anybody have any good tricks or something? I guess I could do a
> series of casts, using the try catch option? Any help would be
> greatly appreciated.
string strNumber = "<string to evaluate>";
decimal decTest;
if(Decimal.TryParse(strNumber, NumberStyles.Number, null, out decTest))
{
strNumber = "$" + Convert.ToDecimal(strNumber).ToString("#,##0.00");
}

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Ghostman - 07 Sep 2007 16:35 GMT
I agree with Mark's post, except i'd change it to
string strNumber = "<string to evaluate>";
decimal decTest;
if(Decimal.TryParse(strNumber, NumberStyles.Number, null, out
decTest))
{
strNumber = "$" + decTest.ToString("#,##0.00");
}
Unless there's a reason to convert it twice...
Mark Rae [MVP] - 07 Sep 2007 16:56 GMT
> Unless there's a reason to convert it twice...
None whatsoever - good suggestion...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net