well, problem solved, alas it was something different than I had expected.
The main problem was, a code I had overlooked in another file which is linked to this one and which is the one which actually displays the $product variable. Problem was that on that file I had used number_format too, so the two number_formats were overlapping and causing a big problem. I did not notice visually because in the page I was working on, the value was null or 0. I noticed the problem when I loaded another page where the value was 15,000 and the overlap was causing it to dispaly just 15.
By eliminating the overlap I was finally able to get NULL to be recognized. However, I still would have had the problem if I didn't apply Roger Ramjet's last suggestion in putting the NULL statement first in the if(). That was what worked. Curiously changing the default settings on mySQL had no effect, even if the default is 0, which is good since the nature of my data means i'd rather have a default of 0 than NULL.
All in all, thanks to everyone for their suggestions, particularly Roger Ramjet. I really appreciate it.