How do I convert a string with commas into a double?

I have a number that I am reading from a file.  It is saved with comma formatting, i.e., 2,000,000.00 etc.  When I try to use Double.Parse(valToConvert) it gives me an exception.  Is there a way without writing code to extract out the pure number to convert this?

Thanks

Note to Experts Exchange - the selecting of the time zone feature is aweful!  I can't find eastern standard time.
LVL 1
James CochraneB2B FINTECH WRITER/Technology WriterAsked:
Who is Participating?
 
Jaime OlivaresSoftware ArchitectCommented:
use:
double val = double.Parse(valToConvert.Replace(",",""));
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.