By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,967 Members | 2,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,967 IT Pros & Developers. It's quick & easy.

Double value 0.0 classed as Nothing?

P: 116

I am retrieving JSON data. Not all parameters are returned each time and some that are returned might be a double value of 0.0.

The problem is, I thought that I could just check if the parameter was returned by using the following....

Expand|Select|Wrap|Line Numbers
  1. 'mydata is the parsed JSON response, value1 is a double value
  2. If Not mydata.value1 Is Nothing Then
  3. ' process
  4. Else
  5. 'ignore
  6. End If
However if mydata.value1 = 0.0 it seems to treat this as Nothing and bypasses the processing.

I can't convert it to another format since as soon as I try to do that it will crash if mydata.value1 isn't part of the returned data.

Is there another way to determine if the parameter was returned in the response other than 'Nothing'?


EDIT: At the moment I'm forcing the response value to be read as a string which seems to help but there has to be a proper way to do this since the true data is returned as a double
Mar 29 '15 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.