Guest cory feco Posted August 11, 2009 Share Posted August 11, 2009 I'm sure this is a simple fix but I can't find the answer through searching, how do I get a form that computes a mathematical formula (like 3-2=(1) or whatever) to show up blank if the answer is 0? I want a number for every other number BUT zero, if its zero I want it to be as if there is nothing in that box.... but not a number showing there's nothing in that box (like 2-2=( ))! Can someone please help me? Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted August 11, 2009 Share Posted August 11, 2009 Can you show us what you have so far (include HTML and JavaScript) Link to comment Share on other sites More sharing options...
Ingolme Posted August 11, 2009 Share Posted August 11, 2009 That's what the if() statement is for.Here's q quick example: function sum(x,y) { var Z = x + y; if(Z == 0) Z = ""; return Z;}sum(3,-3); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.