Double and Parse

  • Thread starter Thread starter MAF
  • Start date Start date
M

MAF

I am seeing the following behavior for my code. If I pass in 0 the system
thinks the value is a string, but if I use 0.0 I believe I get a double
value. Has anyone else seen this behavior, am I doing something wrong?

double tmp = Double.Parse(m_Value.ToString());
 
MAF said:
I am seeing the following behavior for my code. If I pass in 0 the system
thinks the value is a string, but if I use 0.0 I believe I get a double
value. Has anyone else seen this behavior, am I doing something wrong?

double tmp = Double.Parse(m_Value.ToString());

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top