5
Answers

Very easy - but stumped! convert to currency

Ingrid

Ingrid

17y
1.9k
1
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)