Ingrid

Ingrid

  • NA
  • 3
  • 0

Very easy - but stumped! convert to currency

Jun 28 2007 10:25 AM
Hi,

OK. This is a very easy problem - that I can't find an answer for. I'm sure I'll fell dumb when I (you) figure it out.

I'm converting a string to currency. Nothing happens. It returns the same string - but not in catch - it is NOT going into catch.. Here's my function:

samples:

input:16406, 136.54
output: 16406, 136.54

public string currencyConvert(string money)
{
  string curr ="";

  try
  {
    curr =
string.Format("{0:C}", money);
  }
  catch

  {
    curr = money
;
  }
 
  return
curr;
}


Answers (5)