Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
5
Answers
Very easy - but stumped! convert to currency
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Ingrid
17y
1.9k
1
Reply
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;
}
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
Array.Copy Question
Throughput/Design problem